3

使用 rvm 安装 Rails 后,我遇到了以下错误:

/afs/andrew.cmu.edu/usr11/kvudata/.rvm/rubies/ruby-1.9.3-p327/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.

因此,为了获得更多信息,我去了 irb 并尝试要求“心理”:

1.9.3-p327 :001 > require 'psych'
LoadError: libyaml-0.so.2: cannot open shared object file: No such file or directory -/afs/andrew.cmu.edu/usr11/kvudata/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/x86_64-linux/psych.so

但是当我导航到它试图找到的指定位置时psych.so,它就存在了!

我曾尝试卸载 ruby​​ 并重新安装以及卸载、从源代码编译 libyaml,然后重新安装 ruby​​,但无济于事,错误并没有消失。

4

1 回答 1

3

这感觉不像是一个“真正的”解决方案,但我能够让事情正常进行。

就我而言,libyaml 安装在/usr/local/lib. 将该路径添加到我的环境变量中就可以了(受Shared Libraries启发)。我将以下内容添加到我的 .bash_profile

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

对于像我一样尝试使用 capistrano 进行这项工作的其他访问者,将其添加到我的 deploy.rb 工作:

set :default_environment, {'LD_LIBRARY_PATH' => '/usr/local/lib'}

我期待着更明智的建议。

于 2012-11-27T03:16:16.030 回答