[Debian squeeze]

It has been surprisingly difficult to find an answer for this.

I had ruby v1.9.1 installed (/usr/bin/ruby1.9.1), but after I then installed rubygems, it also installed ruby1.8 (/usr/bin/ruby1.8), and all the commands I run on gem (gem install ..., rails ...) are all using ruby v1.8.

~/proj/rails/demo# bundle show sqlite3

How do I get rubygems and rails to use the v1.9.1 which I have installed, instead of v1.8?

(side note: I did install rvm using "gem install rvm", but after I did that, I am not able to execute rvm, what's up with that?)


Did you update /etc/alternatives? On the ubuntu side of things, you'd run "sudo update-alternatives", and tell the system what the symlink for "/usr/bin/ruby", "/usr/bin/gem", etc., actually point to. I'm not sure if "update-alternatives" is in Debian, but there should be a similar method of pointing at the version you want.

Hmm. This is a bit old, but is probably applicable:



On Debian the rubygems package is just a meta-package which depends on rubygems1.8, the same way ruby just depends on ruby1.8. Thus, if you want rubygems for 1.9, you need to install rubygems1.9. The gem command (as all other potential executables like ruby, irb or ri) is just a symlink pointing to the preferred version like gem1.8. You can use those directly or you can use update-alternatives to set the preferred version.

Regarding RVM, it's true that there is a gem but it contains just some helpers for RVM. RVM doesn't require a pre-installed ruby. In fact, often it is used as the single way to install rubies on systems.

To actual install RVM, run

bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

as described on RVM's install guide. Please refer to it for more information about various install variants.


You need to use RVM (Ruby Version Manager), which can switch ruby versions easily.

To shift to Ruby version 1.9.1, try

rvn use 1.9.1

to make this version default, use

rvn use 1.9.1 --default

If you need to learn about basics of rvm, please follow this tutorial, which explains some more details about how to use RVM.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.