rvmsudo vs sudo?

时间:2011-04-28 11:02:17

标签: ruby-on-rails rvm sudo

我刚搬到RVM。

sudo bundle install给了我错误: -

 sudo bundle install
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:900:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:248:in `activate'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:1276:in `gem'
from /usr/local/rvm/gems/ruby-1.9.2-p180/bin/bundle:18:in `<main>'

rvmsudo bundle install 

就像一个魅力。有什么不同。什么在屏幕后面发生。任何人都可以解释..

1 个答案:

答案 0 :(得分:50)

sudo启动一个不包含环境变量的新子shell rvmsudo传递RVM设置的任何环境变量,以使您获得正确的Ruby。这包括$PATH以及$GEM_HOME$GEM_PATH$BUNDLE_PATH变量。

http://ruby.about.com/od/rubyversionmanager/qt/Rvm-And-Sudo.htm