Activities

January 2013
M T W T F S S
« Dec   Mar »
 123456
78910111213
14151617181920
21222324252627
28293031  

Installing Ruby On Rails using RVM installer on CentOS

Earlier in 2007 I uses Ruby custom installation for rails deployment. ie compiling from source along with readline support then Rails alone. Technologies getting improved and hence reducing human efforts.

Here is the easier steps I’ve ever found from Google.

1. Installing curl and RVM

[root@fc-web01LA ~]#yum install curl
[root@fc-web01LA ~]# curl -L get.rvm.io | bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10956  100 10956    0     0   4234      0  0:00:02  0:00:02 --:--:-- 22730
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1243k  100 1243k    0     0   168k      0  0:00:07  0:00:07 --:--:--  391k

Installing RVM to /usr/local/rvm/
    Creating RVM system user group 'rvm'
[root@fc-web01LA ~]#source /etc/profile.d/rvm.sh
[root@fc-web01LA ~]#yum install  gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
[root@fc-web01LA ~]#

2. Identifying rvm Requirements

[root@fc-web01LA ~]# rvm requirements
Requirements for Linux ( CentOS release 6.2 (Final) )
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
             This is the *original* / standard Ruby Language Interpreter
      'ree'  represents Ruby Enterprise Edition
      'rbx'  represents Rubinius
bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).
To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
  ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ## NOTE: For centos >= 5.4 iconv-devel is provided by glibc
# For JRuby, install the following:
  jruby: yum install -y java
[root@rc-136 ~]# rvm requirements
Requirements for Linux ( CentOS release 6.2 (Final) )
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
             This is the *original* / standard Ruby Language Interpreter
      'ree'  represents Ruby Enterprise Edition
      'rbx'  represents Rubinius
bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).
To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
  ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ## NOTE: For centos >= 5.4 iconv-devel is provided by glibc
# For JRuby, install the following:
  jruby: yum install -y java
[root@fc-web01LA ~]#

3. Installing Ruby
Pls note that you can refer any valid Ruby version over here. I uses the latest stable version of 1.9.

[root@fc-web01LA ~]#rvm install 1.9.3
[root@fc-web01LA ~]#rvm use 1.9.3 --default

4. Installing RubyGem respect to the Ruby version

[root@fc-web01LA ~]#rvm rubygems current

5. Installing Rails

[root@fc-web01LA ~]#gem install rails

Use Rails with Ngnix platform for the deployment which is an easy way to go.

The following steps will guide you how to setup Nginx server.

[root@fc-web01LA ~]#gem install passenger
[root@fc-web01LA ~]#passenger-install-nginx-module

Happy Rails 🙂

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>