rvmsudo 与 sudo? [英] rvmsudo vs sudo?

查看:71
本文介绍了rvmsudo 与 sudo?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚搬到 RVM.

sudo bundle install 给了我错误:-

sudo bundle install gives me and error:-

 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 

就像一个魅力.有什么不同.屏幕后面发生了什么.谁能解释一下..

works like a charm. Whats the difference. Whats going on behind the screen. Can anybody explain..

推荐答案

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

sudo starts a new subshell that does not contain environment variables.
rvmsudo passes on any environment variables that RVM set up to get you to the correct Ruby. This includes the $PATH as well has $GEM_HOME, $GEM_PATH and $BUNDLE_PATH variables.

https://rvm.io/integration/sudo

这篇关于rvmsudo 与 sudo?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆