开发者

gem --version different to sudo gem --version :(

开发者 https://www.devze.com 2023-01-16 02:39 出处:网络
I\'m a bit of a Linux noob trying to get ruby, rails, mysql and sqlite all playing nicely on ubuntu 10. I am getting errors, and I realized that the versions are different for sudo versus normal user!

I'm a bit of a Linux noob trying to get ruby, rails, mysql and sqlite all playing nicely on ubuntu 10. I am getting errors, and I realized that the versions are different for sudo versus normal user!

mpw@ubuntu:~/.rvm/gems/ruby-1.9.2-p0$ gem --version
1.3.7
mpw@ubuntu:~/.rvm/gems/ruby-1.9.2-p0$ sudo gem --version
1.3.5

I have used RVM to install it, but it seems that I have conflicting v开发者_StackOverflow社区ersions. How to fix?


I did the same installation mistake before, but following these instructions worked. http://ascarter.net/2010/05/10/rails-development-on-ubuntu-10.04.html


sudo gem --version most likely is using the system gem i.e the one you get when you do rvm system. This is because sudo changes user to root and you probably didn't do sudo rvm use 1.9.2 or something similar. Try doing sudo which gem and which gem to confirm this.

You can update the version used by root by doing sudo gem update --system. However note that you are still most likley using different gem paths when using sudo gem and gem if you are not using the system gem executable by default i.e rvm use system.


Please try a

sudo which gem 

resp

which gem 

to get the information which gem you are using. I second the opinion of the answer above that most probably you are using different gem versions and paths.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号