Posted on Jun 16
Below are some excerpts of my command history when I set up the rbenv to install ruby and some gems.
$ uname -a
Linux xxx 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
sstephenson/rbenv enables to switch Ruby versions in an application-specific manner. It can be installed by cloning the rbenv repository from GitHub. In the following example, rbenv is installed under the home directory.
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
sstephenson/ruby-build is a plugin for rbenv
that builds a specific version of Ruby.
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
On Ubuntu, the following packages are required to build Ruby 1:
$ sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
The following command installs v2.0.0-p645 and selects it as the global Ruby version:
$ rbenv install 2.0.0-p645
$ rbenv global 2.0.0-p645
The rbenv-gemset plugin enables to set up and maintain application-specific gemsets. It can be installed in the same way as other plugins.
$ git clone git://github.com/jf/rbenv-gemset.git $HOME/.rbenv/plugins/rbenv-gemset
$ rbenv gemset create 2.0.0-p645 new-gemset
We can specify the newly created gemset in an application directory:
$ cd application-directory
$ echo new-gemset > .rbenv-gemsets
We can confirm the currently active gemset:
$ rbenv gemset active
$ rbenv gemset file
2015 My gh-pages