我正在尝试安装rubygems,但收到以下错误:
'$ rvm install ruby
.........
Installing rubygems-2.1.11 for ruby-2.0.0-p353............
Error running 'env GEM_PATH=/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353:/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353@global:/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353:/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353@global GEM_HOME=/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353 /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -d /Users/Vasenka/.rvm/src/rubygems-2.1.11/setup.rb',
please read /Users/Vasenka/.rvm/log/1386179561_ruby-2.0.0-p353/rubygems.install.log
Installation of rubygems did not complete successfully.
........
Making gemset ruby-2.0.0-p353
pristine..............
Error running '__rvm_with ruby-2.0.0-p353 /Users/Vasenka/.rvm/scripts/gemsets pristine',
请阅读/Users/Vasenka/.rvm/log/1386183855_ruby-2.0.0-p353/gemset.pristine-ruby-2.0.0-p353.log
.rvm / log / 1386179561_ruby-2.0.0-p353 / rubygems.install.log状态:
[2013-12-04 17:59:26] /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
current path: /Users/Vasenka/.rvm/src/rubygems-2.1.11
command(6): env GEM_PATH=/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353:/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353@global:/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353:/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353@global GEM_HOME=/Users/Vasenka/.rvm/gems/ruby-2.0.0-p353 /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -d /Users/Vasenka/.rvm/src/rubygems-2.1.11/setup.rb
Exception `LoadError' at /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems.rb:1087 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems.rb:1096 - cannot load such file -- rubygems/defaults/ruby/Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 29 (Psych::SyntaxError)
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:in `load'
from /Users/Vasenka/.rvm/src/rubygems-2.1.11/lib/rubygems/config_file.rb:332:in `load_file'
from /Users/Vasenka/.rvm/src/rubygems-2.1.11/lib/rubygems/config_file.rb:197:in `initialize'
from /Users/Vasenka/.rvm/src/rubygems-2.1.11/lib/rubygems/gem_runner.rb:74:in `new'
from /Users/Vasenka/.rvm/src/rubygems-2.1.11/lib/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/Vasenka/.rvm/src/rubygems-2.1.11/lib/rubygems/gem_runner.rb:39:in `run'
from setup.rb:45:in `<main>'
安装了命令行开发人员工具。 Ruby已成功安装。 。
$ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
但是宝石都错了:
$ gem -v
/Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 29 (Psych::SyntaxError)
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:in `load'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/config_file.rb:319:in `load_file'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/config_file.rb:192:in `initialize'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `new'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `do_configuration'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in `run'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/bin/gem:21:in `<main>'
试过这个:
$ rvm requirements
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
rvm get stable
Downloading https://get.rvm.io
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz
Upgrading the RVM installation in /Users/Vasenka/.rvm/
RVM PATH line found in /Users/Vasenka/.bashrc /Users/Vasenka/.zshrc.
RVM sourcing line found in /Users/Vasenka/.bash_profile /Users/Vasenka/.zlogin.
Installing rvm gem in 1 gemsets /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 2 column 29 (Psych::SyntaxError)
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:in `load'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/config_file.rb:319:in `load_file'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/config_file.rb:192:in `initialize'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `new'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `do_configuration'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in `run'
from /Users/Vasenka/.rvm/rubies/ruby-2.0.0-p353/bin/gem:21:in `<main>'
答案 0 :(得分:1)
答案 1 :(得分:0)
升级到Mavericks后,libyaml可能存在问题或与xcode相关的问题:
$ xcode-select --install # if you upgraded to Mavericks
$ brew update # if using homebrew
$ rvm get head # to get lastest rvm
$ rvm pkg install libyaml
$ rvm pkg install readline
$ rvm reinstall all --force
其他可能性是~/.gemrc
如果这些都不起作用,请为OSX尝试rvm GUI ruby manager(免费)或为您设置RVM的RailsInstaller。
答案 2 :(得分:0)
可以尝试使用此rvm reinstall 2.0.0 --verify-downloads 1