我正在开发Mac Snow Leapord
在安装RVM之前,我已经尝试(但失败)升级OSX的默认ruby。
使用
完成Ruby的安装rvm install 1.9.2
with ruby -v
:
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
gem是1.7.2安装有sudo gem install rails
的滑道Rails已经安装,没有错误提示。
With rails -v
:
/Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:926:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:244:in `activate_dep'
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:236:in `activate'
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1307:in `gem'
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/bin/rails:18:in `<main>'
我已经安装了gem,否则我就不能做gem install rails
有人知道原因或解决办法吗?
问题是当您使用rvm时使用sudo安装rails。试试这个:
$ rvm use 1.9.2
$ gem install rails
HTH
是否为当前用户安装gem install rails
(而不是sudo) ?