This way several ruby versions can be installed individually and it's easy to switch between them.
Installing prerequesties
sudo apt-get install bash curl git-core build-essential bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev curl git-core libyaml-dev libxslt-dev autoconf libmysqlclient-dev libreadline5 libltdl-dev libncurses5-dev libserf1-dbg libsvn1 libtool subversion libgdbm-dev pkg-config libffi-dev@Installation rvm (Ruby Version Manager): Be sure to switch to the user you want to use this Ruby with. Rubies are installed on a per user basis.
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)Append the following to your .bashrc-File, that is located ad /home/«YOUR_USER_NAME»/.bashrc
That's done easiest with nano ~/.bashrc, because nano gives you help to store, leave, etc. at the bottom line, when started
@source /home/%USER%/.rvm/scripts/rvm@To test, if everything's fine close your terminal and start a new one and test
@type rvm | head -n1@The output has to be rvm is a function (or a translated version of that text). Otherwise something went wrong.
To let rvm install missing libraries in the future automatically (this is an optional step)
rvm autolibs 3Install the latest ruby
rvm install rubyTo install latest hobo
gem install hoboA fitting rails version is installed automatically. You are done!
Install a certain ruby version (e.g.)
rvm install ruby-2.1.5To select a ruby as default
rvm --default use 2.1.5To use a ruby just for this session
rvm use 2.1.5Check which rubies are installed
rvm list rubiesCheck which rubies rvm can install
rvm list knownDo you want to improve these instuctions? Please comment here in the gists or send me an email [email protected]