Ubuntu ships with ancient versions of the Ruby interpreter and its tools. The preferred method to installing the latest version of Ruby from source is using rbenv.
- Install and setup
ruby-buildplugin from source as described here.
List the versions of Ruby available for installation:
$ rbenv install -l
- Pick a fairly recent version for installation from source. For example, I picked:
$ rbenv install 2.1.5
Trying the latest
2.2.0 gave build errors on my system, but I was able to install
- After installation is done, set this version of the Ruby interpreter as the default for you:
$ rbenv global 2.1.5
- Now you can run this Ruby interpreter from your shell:
$ ruby --version
Now you can also install other gems using the
gem tool that is also built along with Ruby.
Tried with: rbenv 0.4.0 and Ubuntu 14.04