Install Ruby and Ruby on Rails on Ubuntu 12.04

 

Preconditions

First, lets update apt-get

1
sudo apt-get update

then, we will install curl, if not installed yet

1
sudo apt-get install curl

 

Install RVM (Ruby Version Manager)

1
\curl -L https://get.rvm.io | bash -s stable

Now we have to load RVM

1
source ~/.rvm/scripts/rvm

To see what is required for RVM use command:

1
rvm requirements

The output shows something like this:

1
2
# For ruby:
sudo apt-get –no-install-recommends install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev

Just follow the instructions to get your system up to date with all of the required dependancies.

1
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl 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

 

Install Ruby

Install Ruby and make the installed version default

1
2
3
rvm install 1.9.3
rvm use 1.9.3 –default

 

Install RubyGems

 

1
rvm rubygems current

 

Install Rails

 

1
gem install rails

 

If you have trouble with using rake command with error:

1
2
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.

then install the following:

1
2
sudo apt-get install libv8-dev
sudo apt-get install nodejs

and add

1
gem ‘execjs’

to your GEMFILE

 

Install Phusion Passenger as your Server (Optional)

Check the newes version on: http://rubygems.org/gems/passenger/versions/4.0.0.rc4 and add this to your Gemfile

1
gem “passenger”, “~> 4.0.0.rc4”

or install it directly just on your server:

1
gem install passenger -v 4.0.0.rc4

 

Leave a comment

Leave your opinion

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: