I want to install a rails environment on Ubuntu 11.04. I tried:

$ sudo apt-get install ruby-rvm

But got the error:

Unable to locate package ruby-rvm

My other PC has Ubuntu 11.10, and this works fine there:

$ sudo apt-get install ruby-rvm
$ rvm install ruby-1.9.3-p125
$ sudo gem update --system
$ sudo gem install rails

The ruby-rvm package is only present since Ubuntu 11.10. Furthermore, one of its dependencies, libreadline-gplv2-dev, only exists under this name since Ubuntu 11.10.

There is a version of ruby-rvm in the Canonical-SIG 3rd party testing PPA. It's for testing, so there may be bugs. See Add a Personal Package Archive (PPA) in the Ubuntu documentation for how to install software from a PPA.

You can grab the package source and compile it on your machine. Download the source from the Ubuntu 11.10 package page (you need all three files: .dsc, .orig.tar.gz and .debian.tar.gz). Install development tools and build dependencies, compile the package, install run-time dependencies and install the package.

wget http://archive.ubuntu.com/ubuntu/pool/universe/r/ruby-rvm/ruby-rvm_1.6.9-0ubuntu2.dsc http://archive.ubuntu.com/ubuntu/pool/universe/r/ruby-rvm/ruby-rvm_1.6.9.orig.tar.gz http://archive.ubuntu.com/ubuntu/pool/universe/r/ruby-rvm/ruby-rvm_1.6.9-0ubuntu2.debian.tar.gz
sudo apt-get install build-essential fakeroot debhelper ruby
dpkg-source -x ruby-rvm_1.6.9-0ubuntu2.dsc
cd ruby-rvm*
dpkg-buildpackage -rfakeroot -b -nc -us -uc
cd ..
apt-get install adduser bison curl file git libreadline5-dev libsqlite3-dev libxml2-dev zlib1g-dev
dpkg -i ruby-rvm_1.6.9-0ubuntu2_*.deb
| improve this answer | |

A simple way to install RVM is to follow the instructions at the developer's site (in fact, the site says "Please use the install process(es) from this site only, as this is the only supported installation types and methods."):

curl -L get.rvm.io | bash -s stable

Load RVM:

source ~/.rvm/scripts/rvm

Find the requirements (follow the instructions):

rvm requirements

Install ruby:

rvm install 1.9.3

On my system (12.04), this all went without a hitch; requirements listed were easy to find and install using apt-get.

| improve this answer | |

Precise, Trusty, Xenial and higher

There is now an official Ubuntu package: https://github.com/rvm/ubuntu_rvm


1. Add the PPA and install the package

Open a terminal (Ctrl+Alt+T) and run:

sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm

2. Change your terminal window

Now, in order to always load rvm, change the Gnome Terminal to always perform a login.

At terminal window, click Edit > Profile Preferences, click on Command tab and check Run command as login shell.

enter image description here

3. Logout and login

A lot of changes were made and in order to properly get all them working, you need to login and logout. This requires not only close terminal window, but really logout and login again.

4. Install a ruby

Now you're ready to install rubies. Open a terminal (Ctrl+Alt+T) and run:

rvm install ruby
| improve this answer | |
  • Errors on your instructions when i hit "install rvm". See here: prntscr.com/5oykdf -- unmet dependencies, but shouldn't it just download it by itself? this is why i find installing stuff in linux soooo frustrating. Everyone's setup is different. Why can't it just install the dependencies too? – Patoshi パトシ Jan 5 '15 at 22:35
  • Yes, it should download all dependencies itself. Really weird the messages in your screenshot. As you can see here, by example, gawk is available on Precise. Appears you don't have any sources in your /etc/apt/sources.list file. – Rael Gugelmin Cunha Jan 6 '15 at 0:27
  • @duckx I've just downloaded a Precise ISO to check and all worked fine. Probably you're facing one issue with apt. Try these commands to fix your apt: sudo rm var/lib/apt/lists/* -vf then sudo apt-get update. Then try install again. – Rael Gugelmin Cunha Jan 6 '15 at 1:31
  • thanks!.. just tried those 2 commands you gave me and I'm getting this still: prntscr.com/5p1ff3 --- ::sigh:: linux -_- how did you guys even learn it? – Patoshi パトシ Jan 6 '15 at 2:58
  • Your install has problems. Can you open another question for this, as this is out of the scope of this question? I can help you. – Rael Gugelmin Cunha Jan 6 '15 at 10:54

Try to search ruby-based packages via:

apt-cache search ruby

or you can add | grep ^ruby, if you know, that name of this package started by ruby.

| improve this answer | |
  • the ruby-rvm package not exist for ubuntu 11.04 apt-cache search ruby | grep ^ruby => no package with ruby rvm – Yosef Mar 19 '12 at 14:22

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.