Installation Guide: Ruby On Rails: Ubuntu 14.04

2 Min. Read
Oct 10, 2014

 Rails Ruby JS Install Node JS Node Ubuntu

Installing Ruby


RVM is the best Tool to manage multiple versions in your system.

1
2
3
# Update your package manager first:

$ sudo apt-get update
1
2
3
4
# Install dependencies for ruby
# This installs CURL, Git and other dependencies

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
# To get the signature
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

if it fails:

 command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -L https://get.rvm.io | bash -s stable
For all in one installation append --rails or --ruby or --ruby=1.9.3
Note: RVM might not be available right after installation is complete. Restart the terminal once after installation is completed.
#[rvm install ruby] installs latest version of ruby
rvm install 2.1.2
rvm use 2.1.2 --default

# Check the version of ruby installed
ruby -v

Configuring Git

1
2
3
4
5
6
7
8
9
10
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"

# Create SSH Key
ssh-keygen -t rsa -C "YOUR@EMAIL.com"

# Now you need to add this public key to your github account
# You need to copy and paste the content of ~/.ssh/id_rsa.pub file to https://github.com/settings/ssh
# after clicking Add SSH Key buttton
1
2
3
4
5
6
7
8
# Once you have done this, you have to type following command to check
# if it worked

ssh -T git@github.com

# Hopefully, you will get this echoed

"Hi excid3! You've successfully authenticated, but GitHub does not provide shell access."

Installing Rails


We need to install javascript runtime like NodeJS. This will let you use CoffeeScript and Gems you use to minify your javascripts (such as uglifier).

To install NodeJS, we need to add it using a PPA repository:

1
2
3
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
1
gem install rails
1
2
3
4
# Check the version of rails installed

rails -v
# Rails 4.1.6

Setting Up MySQL

1
sudo apt-get install mysql-server mysql-client libmysqlclient-dev

Installing the libmysqlclient-dev gives you the necessary files to compile the mysql2 gem which is what Rails will use to connect to MySQL when you setup your Rails app.

You might also like

You might find a easy guide to convert your existing stripts to Ruby Gems and Publish.
Read More..

Installing Ruby RVM is the best Tool to manage multiple versions in your system. # Update your package manager first: $ sudo apt-get update # Install dependencies for ruby # This installs CURL, Git and other dependencies 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 sudo apt-get […]


Read More..


Write To Me

Hire me shiva bhusal
We'll never share your email with anyone else.
I'll never share your email with anyone else.