/ Linux

Setup Ruby on Rails for CentOS

Ruby on Rails, or simply Rails, is a web application framework written in Ruby.

Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages.

Lets get started with our setup:

Install Packages:

$ yum install ruby -y

Install Dependencies:

$ yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel -y
$ yum install ruby-rdoc ruby-devel -y

Install Ruby Gems:

$ yum install rubygems -y

or

Install Ruby Gems from source

$ mkdir ~/src
$ cd ~/src
$ wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz?tar -zxvf rubygems-1.3.6.tgz
$ cd rubygems-1.3.6
$ ruby setup.rb

Install Rails:

$ gem update
$ gem update --system
$ gem install rails 
       or
$ gem install rails -V