Setting Up Rails

26 April 2015

I bought the Web Designer Issue 233 being interested with jQuery effects but it turned out that I will find something far more interesting. I found a gem inside the magazine, it was a ruby! This issue discussed how to start learning rails. As rails website define it, Ruby on Rails® is an open-source web framework that’s optimised for programmer happiness and sustainable productivity. It lets you write beautiful code by favouring convention over configuration.

To be able to setup rails, we need to setup the dependencies first. The first requirement is ruby of course.

Installing ruby

$ apt-add-repository ppa:brightbox/ruby-ng
$ apt-get update
$ apt-get install ruby2.2
$ ruby -v
  ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux-gnu]

Installing database options

$ apt-get install sqlite3 libsqlite3-dev
$ sqlite3 --version
  3.8.2 2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d

$ apt-get install postgresql-9.3
$ psql --version
  psql (PostgreSQL) 9.3.6

Other dependencies

$ apt-get install nodejs
$ apt-get install ruby2.2-dev libssl-dev libreadline-dev
$ apt-get install libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev

Finally

$ gem install rails -v 4.2.0
$ rails -v
  Rails 4.2.0