开发者

How do I switch back to ruby 1.8.7 from ruby 1.9.2?

I have following ruby versions (I'm on linux (Ubuntu))

rvm list

   ruby-1.8.开发者_开发百科7-p302 [ i386 ]
   ruby-1.9.1-p378 [ i386 ]
=> ruby-1.9.2-p0 [ i386 ]

When I do:

sudo rvm --default use 1.8.7

My RVM Ruby version changed to:

=> ruby-1.8.7-p302 [ i386 ]
   ruby-1.9.1-p378 [ i386 ]
   ruby-1.9.2-p0 [ i386 ]

But it doesnt change my system gem version:

ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

How to change my system ruby version to 1.8.7?


Using:

sudo rvm --default use 1.8.7

changes it for root, not for you. Remember, RVM is primarily for creating a sandbox for you as a user, not for the system or another user. Since you've been using sudo, which is a bad thing, you probably have things that are now owned by root, not you, which will cause your Ruby system to behave like it's psycho. Use chown to switch the ownership of all files in ~/.rvm back to you.

Use:

rvm system

to switch back to the default Ruby in /usr, /usr/local or /opt. Which one is called at that point will be determined by your PATH settings.

To switch between versions in your account that display when you do rvm list, use:

rvm use 1.8.7

or simply

rvm 1.8.7

If you want to make that the default version that is sticky, add on --default to the end of the command.


 rvm use 1.8.7 # WITHOUT SUDO

And don't use sudo with RVM. RVM is a thing to avoid sudo.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜