我在 Mac OSX 10.7.4 上。所以我在 root 时用 RubyGem 安装了 rails。
当我是 root 时,rails -v
会产生这个:
bash-3.2# rails -v
Rails 3.2.8
但是,当我不是 root 时rails -v
,会产生以下结果:
Sreejiths-MacBook-Pro:~ sreejith$ rails -v
/opt/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [bundler-1.2.1, rake-0.9.2.2, rubygems-bundler-1.1.0, rvm-1.11.3.5] (Gem::LoadError)
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:1231:in `gem'
from /opt/local/bin/rails:22
为什么会这样?