Skip to main content

Basic steps to setup RVM

The next time you decide to install ruby for multiple applications, rvm is the best option to handle various versions easily. Just follow the below steps which i have compiled to make things clear and easy:

Install rvm,Ruby 1.9.2 and rails 3.0.0

Execute the commands as specified:

$ which ruby
$ sudo apt-get install curl git-core ruby
$ bash < <( curl )
$ vim $HOME/.bashrc

You need to replace the line that says

       [ -z "$PS1" ] && return


       if [[ -n "$PS1" ]]; then

Now add this to the last line of the file

       if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi

Reload the environment by running

$ source ~/.bash_profile or restart the terminal

Now enter,
$ rvm notes

This lists the packages to be installed for various ruby flavours, install the packages under the MRI & ree section as we require 1.9.2.

$ sudo aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev git-core subversion autoconf

$ rvm list known
$ rvm package install readline  or use rvm pkg install readline
$ rvm install 1.9.2-head -C --with-readline-dir=$HOME/.rvm/usr
$ rvm --default 1.9.2-head
$ ruby -v
$ gem install rails

So, the installation is complete and you can start with your first project. I would suggest you to refer this link and install the basic libraries which are required by various gems when you use then in your application.

Installing on Ubuntu

These libraries needs to be installed with sudo permissions and are installed once. There are issues with bundle install which gives errors like building with native extensions and then displays the list of errors. To fix those errors just checkout the installation fails for which gem and install the libraries suggested or search the appropriate libraries.


Popular posts from this blog

Cannot allocate memory error while computing files - Setup Swap space

ActionView::Template::Error (Cannot allocate memory - nodejs /tmp/execjs20131021-26716-fckzo3.js 2>&1
Nodejs is used to compile javascript at runtime. In RoR applications, this error comes when server is started in production mode which compiles the assets or while running rake assets:precompile.
check for swap space and allocate

Fresh server start after instance degraded

So the issue was, amazon issued an warning regarding the server to be terminated, before i could think of making an backup the instance stopped.

The troubleshoot operations like reboot, stop and start didn't worked.
Simple Steps to start a fresh instance with the previous content on server.