I'm newbie on both ruby and linux, so I'm sure this is trivial but I don't know yet. I currently have ruby 1.8.7 installed and I want to update it to ruby 1.9. How can I do that?
One way open the terminal window (sometimes called a "shell" or "bash shell") is to select Applications > Accessories > Terminal. Run the command which ruby. If you see a path such as /usr/bin/ruby, Ruby is installed.
The easiest way to install Ruby on your Ubuntu system is through the apt package manager. At the time of writing, the version in the Ubuntu repositories is 2.5. 1 which is the latest stable version of Ruby.
sudo apt-get install ruby1.9
should do the trick.
You can find what libraries are available to install by
apt-cache search <your search term>
So I just did apt-cache search ruby | grep 9
to find it.
You'll probably need to invoke the new Ruby as ruby1.9
, because Ubuntu will probably default to 1.8 if you just type ruby
.
There's really no reason to remove ruby1-8, unless someone else knows better. Execute the commands below to install 1.9 and then link ruby to point to the new version.
sudo apt-get install ruby1-9 rubygems1-9 sudo ln -sf /usr/bin/ruby1-9 /usr/bin/ruby
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With