安装 OSX 10.8.5 后,我开始出现一些错误,在仔细阅读 stackoverflow 中不同的帖子后,我没有找到正确的答案。我将非常感谢您的帮助
$ rvm -v
rvm 1.23.9 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
.
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.5.0]
.
$ rails -v
-bash: rails: command not found
.
$ gem -v
/usr/local/lib/ruby/2.0.0/yaml.rb:4: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.
/usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': dlopen(/usr/local/lib/ruby/2.0.0/x86_64-darwin12.5.0/psych.bundle, 9): Library not loaded: /usr/local/lib/libyaml-0.2.dylib (LoadError)
Referenced from: /usr/local/lib/ruby/2.0.0/x86_64-darwin12.5.0/psych.bundle
Reason: image not found - /usr/local/lib/ruby/2.0.0/x86_64-darwin12.5.0/psych.bundle
from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/2.0.0/psych.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/2.0.0/yaml.rb:5:in `<top (required)>'
from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/2.0.0/rubygems.rb:595:in `load_yaml'
from /usr/local/lib/ruby/2.0.0/rubygems/config_file.rb:313:in `load_file'
from /usr/local/lib/ruby/2.0.0/rubygems/config_file.rb:190:in `initialize'
from /usr/local/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `new'
from /usr/local/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `do_configuration'
from /usr/local/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in `run'
from /usr/local/bin/gem:21:in `<main>'
当我尝试安装 libyaml 时,我有一些警告
$ sudo rvm pkg install libyaml
Beware, 'rvm pkg ...' is deprecated, read about the new autolibs feature: 'rvm help autolibs'.
Checking requirements for osx.
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0
Installing requirements for osx.
Updating system.....
Error running 'requirements_osx_brew_update_system libyaml',
please read /Users/jcr/.rvm/log/1382177136/update_system.log
Requirements installation failed with status: 1.
Fetching yaml-0.1.4.tar.gz to /Users/jcr/.rvm/archives
Extracting yaml to /Users/jcr/.rvm/src/yaml-0.1.4
Prepare yaml in /Users/jcr/.rvm/src/yaml-0.1.4..
Error running '__rvm_autoreconf -is --force',
please read /Users/jcr/.rvm/log/1382177136/yaml_autoreconf.log
Configuring yaml in /Users/jcr/.rvm/src/yaml-0.1.4..........................................................................................
Compiling yaml in /Users/jcr/.rvm/src/yaml-0.1.4..................................................................................
Installing yaml to /Users/jcr/.rvm/usr......................................
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
.
$ sudo rvm reinstall all --force
$
非常感谢您的帮助