Mate Driven Development

Web Dev over open technologies

Ruby and Rails Setup in Ubuntu 12.10

| Comments

Ok so you want to start development in Ubuntu with Ruby/Rails, follow the instructions below and you well be coding in ruby in a few minutes!

Install RVM

RVM stands for Ruby Version Manager and its going to be your best friend when managing ruby versions an gems.

First we are going to install curl and then use it to install rvm:

$ sudo apt-get install curl
$ curl -L | bash -s stable

To complete installation add the following line at the end of .bashrc:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Close the current shell, open a new one and execute the following command, if installation was successful it should output: rvm is a function

$ type rvm | head -n 1

Install Ruby 1.9.3

First install required dependencies:

$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

And then install ruby:

$ rvm install 1.9.3
$ rvm --default use 1.9.3

Install Rails

This is the easiest part:

$ gem install rails

And you are ready to go!

If you get into any trouble, feel free to ask for help in the comments below.