Add necessary libs
$ sudo apt-get install autoconf automake autotools-dev build-essential bison bzip2 curl git libreadline5 libsqlite3-0 sqlite3 libsqlite3-dev libxml2-dev libmysqlclient-dev libreadline-gplv2-dev libruby openssl libssl-dev zlib1g zlib1g-dev zlibc vim libv8-dev nodejs libmysqlclient-dev libcurl3 libcurl3-gnutls libcurl4-openssl-dev
# Add rvm
$ \curl -sSL https://get.rvm.io | bash
# Add rvm initializer in .bashrc
$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc || source ~/.bashrc
# initializing rvm
$ source ~/.rvm/scripts/rvm
# installing requirements
$ rvm requirements
In case of error of ssh on cloning gems
$ rvm remove 1.9.3 (or whatever version of ruby you are using)
$ rvm pkg install openssl
$ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
In case of error of the ruby racer / Google V8 / Nodejs
$ apt-get install python g++ make
$ mkdir ~/nodejs && cd $_
$ wget -N http://nodejs.org/dist/node-latest.tar.gz
$ tar xzvf node-latest.tar.gz && cd `ls -rd node-v*`
$ ./configure
$ make install