我为缩进而感到抱歉.这是我的第一篇SO帖子,我是设置服务器的新手.我正在学习,并将详细说明我试图解决这个问题以及寻求帮助的步骤.我是一个有抱负的年轻网络开发人员,我在其他人配置的服务器上工作,所以这整个体验对我来说都是新的.
我正在准备一个我最近购买的linode来运行rails应用程序.我按照这里提供的初始安装指南http://blog.blenderbox.com/2011/01/07/installing-rvm-ruby-rails-passenger-nginx-on-centos/,以及更改步骤:
sudo bash< <(curl -L http://bit.ly/rvm-install-system-wide)
反映此SO线程RVM system-wide install script url broken — what is replacement?中建议的更改
bash -c "bash <( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide ) --version '1.3.0'"
我在ngix安装时停止了,因为我正在使用Apache2.我还确保在安装rails之前运行rvm要求并安装必要的软件包.这是libyaml负责安装的地方,我尝试安装它时发生了第一个错误.然而,百胜报道说它不存在. RVM和Gems的初始安装似乎有效,但我遇到了Gems缺少’Psych’的问题,然后要求安装libyaml:
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in’< top(required)>‘:
看来你的ruby安装缺少心理(对于YAML输出).
要消除此警告,请安装libyaml并重新安装ruby.
所以我首先尝试通过Yum安装libyaml但收到此错误:
yum install libyaml Loaded plugins: fastestmirror,security Loading mirror speeds from cached hostfile * base: centosmirror.quintex.com * extras: centosmirror.quintex.com * updates: centosmirror.quintex.com Setting up Install Process No package libyaml available. Error: Nothing to do
尝试安装libyaml-devel和libyaml-dev也遇到了同样的问题.
在做了一些研究之后,我发现CollectiveIdea的这篇博客文章详述了同样的问题并提供了解决方案. Blog Post by Collective Idea我按照说明执行安装,没有任何make或configure问题.然后我执行了重新安装ruby.我仍然被提出相同的警告,并进一步搜索SO以解决类似的问题.正如针对同一问题对此问题的回答所详述,how to solve “ruby installation is missing psych” error?使用:
rvm pkg install libyaml Fetching yaml-0.1.4.tar.gz to /usr/local/rvm/archives Extracting yaml-0.1.4.tar.gz to /usr/local/rvm/src Prepare yaml in /usr/local/rvm/src/yaml-0.1.4. Configuring yaml in /usr/local/rvm/src/yaml-0.1.4. Compiling yaml in /usr/local/rvm/src/yaml-0.1.4. Installing yaml to /usr/local/rvm/usr
请注意,需要重新安装所有ruby:
建议通过RVM重新安装所有内容,我也遵循这些说明.
rvm reinstall all --force Removing /usr/local/rvm/src/ruby-1.9.3-p194... Removing /usr/local/rvm/rubies/ruby-1.9.3-p194... mv: overwrite `/usr/local/rvm/user/installs'? y No binary rubies available for: ///ruby-1.9.3-p194. Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies. Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194,this may take a while depending on your cpu(s)... ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194,this may take a while depending on your connection... ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /usr/local/rvm/src/ruby-1.9.3-p194 ruby-1.9.3-p194 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p194 ruby-1.9.3-p194 - #configuring ruby-1.9.3-p194 - #compiling ruby-1.9.3-p194 - #installing
即使在此之后,警告仍然存在.我用ruby -v验证了ruby安装,实际安装完毕.安装了libyaml文件,它们驻留在这里:
[root@li543-100 ~]# ls -la /usr/local/lib total 19620 drwxr-xr-x 5 root root 4096 Oct 1 15:40 . drwxr-xr-x 13 root root 4096 Oct 1 05:55 .. drwxr-xr-x 2 root root 4096 Oct 1 06:34 include lrwxrwxrwx 1 root root 16 Oct 1 15:40 libruby.so -> libruby.so.1.9.1 lrwxrwxrwx 1 root root 16 Oct 1 15:40 libruby.so.1.9 -> libruby.so.1.9.1 -rwxr-xr-x 1 root root 7457107 Oct 1 06:42 libruby.so.1.9.1 -rw-r--r-- 1 root root 11633486 Oct 1 15:39 libruby-static.a lrwxrwxrwx 1 root root 18 Oct 1 06:37 libyaml-0.so.2 -> libyaml-0.so.2.0.2 -rwxr-xr-x 1 root root 358698 Oct 1 06:37 libyaml-0.so.2.0.2 -rw-r--r-- 1 root root 565584 Oct 1 06:37 libyaml.a -rwxr-xr-x 1 root root 953 Oct 1 06:37 libyaml.la lrwxrwxrwx 1 root root 18 Oct 1 06:37 libyaml.so -> libyaml-0.so.2.0.2 drwxr-xr-x 2 root root 4096 Oct 1 06:45 pkgconfig drwxr-xr-x 6 root root 4096 Oct 1 06:45 ruby -rw-rw-r-- 1 root rvm 194 Oct 1 05:55 rvm
您还可以看到我尝试在/usr/local / lib和/usr/local / rvm / lib之间创建一个符号链接,假设yaml文件可能已安装到错误的目录中或者rvm没有查找在适当的目录中.我在ruby上运行了一个并且认为因为ruby在/ rvm目录中可能是问题所在:
[root@li543-100 ~]# which ruby /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby [1]: http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/
这没有用.因此,我在错误的地方或我不想要的地方.
1:我是否通过将文件放在错误的目录中而导致安装错误?
2:ruby是否在另一个目录中查找libyaml文件?
3:当我关注博客文章时,我无法在安装中添加一些特定于系统的功能?
我已经在我的linode上重新部署了CentOS 4次,希望这是一个问题,我没有适当地遵循脚本,我在第5次部署时出现了同样的问题.
我目前正在搜索2号,希望我的帖子不合适,因为这在其他地方已经明确解决了.我很感激您提供的任何帮助.
编辑:
因此,在重新部署CentOS6.2操作系统后,我运行了更改的设置,如下所示:
yum -y install git yum -y install curl groupadd rvm usermod -a -G rvm root bash -c "bash <( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide) -- version'1.3.0'" echo '[[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" #This loads RVM into a shell session' >> ~/.bash_profile source ~/.bash_profile yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel rvm get head yum install readline readline-devel rvm package install libyaml -v rvm install 1.9.3 -v rvm use 1.9.3 ruby -v
这仍然遇到错误:
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning,please install libyaml and reinstall your ruby.
运行以前的命令从RVM获取libyaml然后重新安装所有ruby似乎并没有解决我的问题.执行rvm重新安装所有–force时,是否会删除,覆盖或替换以前的libyaml软件包的安装?它似乎在正确的目录中.
[root@li543-100 src]# pwd /usr/local/rvm/src drwxrwsr-x 7 root rvm 4096 Oct 1 21:19 . drwxrwsr-x 24 root rvm 4096 Oct 1 20:51 .. drwxr-xr-x 24 root rvm 8192 Oct 1 21:22 ruby-1.9.3-p194 drwxr-xr-x 7 501 games 4096 Apr 27 23:31 rubygems-1.8.24 drwxrwsr-x 18 root rvm 4096 Oct 1 20:51 rvm drwxrwsrwx 8 root rvm 4096 Oct 1 20:27 yaml-0.1.3 drwxr-xr-x 9 root rvm 4096 Oct 1 21:18 yaml-0.1.4
编辑#2:
在新的CentOS 5.6重新部署上再次安装失败之后,我显然在安装过程中遇到了致命的缺陷.在执行rvm install 1.9.3之前,我必须运行rvm install 1.8.7.此外,我这次部署了32位CentOS6.2映像
在1.8.7上运行gem
[root@li543-100 ~]# gem -v 1.8.24
现在我运行rvm install 1.9.2
[root@li543-100 ~]# rvm use 1.9.2 ruby-1.9.2-p320 is not installed. To install do: 'rvm install ruby-1.9.2-p320' [root@li543-100 ~]# rvm install ruby-1.9.2-p320 #CUT OUT INSTALL SHELL PROMPTS ETC [root@li543-100 ~]# rvm use 1.9.2-p320 Using /usr/local/rvm/gems/ruby-1.9.2-p320 [root@li543-100 ~]# gem -v 1.8.24
切换到1.9.3:错误返回
[root@li543-100 ~]# rvm use 1.9.3-p194 Using /usr/local/rvm/gems/ruby-1.9.3-p194 [root@li543-100 ~]# gem -v /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning,please install libyaml and reinstall your ruby. 1.8.24
所以看起来告诉rvm使用1.9.3(请注意,我使用的是-p194,我之前没有测试过)会导致rvm尝试加载libyaml的某些通信问题.现在我将使用1.9.2,因为大部分内容都有点过头了.我确定我在缺少某种依赖性方面犯了一个错误,1.9.3需要或不适当地调整配置文件.至少这是我的假设,第一个服务器设置,这一直是猜测.