Skip to content

Instantly share code, notes, and snippets.

@sadanandkenganal
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sadanandkenganal/cc7c8c2c50a86b6f530f to your computer and use it in GitHub Desktop.
Save sadanandkenganal/cc7c8c2c50a86b6f530f to your computer and use it in GitHub Desktop.
Install Ruby on Rails (ROR) on Ubuntu 14.04

1. Install some dependencies for Ruby.

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

2. using rbenv(recommended : Ruby Environment). Since there are other methods also.

git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
rbenv install 2.2.2
rbenv global 2.2.2
ruby -v

3. Install rails gem.

Installing rails gem requires node.js. To install node.js, we're going to add it using a PPA repository:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Now install rails :

gem install rails -v 4.2.0

4. If you're using rbenv, you'll need to run the following command to make the rails executable available.

rbenv rehash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment