ROR With RVM (Ruby Version Manager)

RVM with ROR

My Requirements of ROR

1. Ruby 1.9.2

2. Rails 3.0.3

3. Sqilte3

4. Gems

a. gem ‘rmagick’

b. gem ‘sqlite3-ruby’, :require => ‘sqlite3′

c. gem ‘clearance’

Install the packages required by rvm

#apt-get install curl libcurl3

#apt-get install git-core liberror-perl

As per requirement

#apt-get install sqlite3

Install rvm:

It will install rvm in /usr/local/rvm

# bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

Locate .bashrc:

if installing as root then it will be in root~ 

#locate .bashrc

#cp .bashrc .bashrc.origional

If installing as user then it will be in user home directory

$cp .bashrc .bashrc.origional

Now echo below mentioned line at the end of .bashrc file

If as root then:

echo ‘[[ -s “$/usr/local/rvm/scripts/rvm” ]] && . “$/usr/local/rvm/scripts/rvm”‘ >> ~/.bashrc

If as user:

echo ‘[[ -s “$HOME/.rvm/scripts/rvm” ]] && . “$HOME/.rvm/scripts/rvm”‘ >> ~/.bashrc

Load .bashrc in shell session

#type rvm | head -1

Now, for installing Ruby 1.9.2, we can check the requirements using rvm notes

#rvm notes | grep “^[ \t]*ruby:”

Result will be as below

ruby: aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf

Install above packages

#apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf

Install ruby-1.9.2 from rvm

#rvm install ruby-1.9.2

Now make ruby-1.9.2 as default

#rvm use 1.9.2 –default

Now list gems

#gem list all

Now search rails

#apt-cache search rails

Now install Rails

#gem install rails –no-ri –no-rdoc

As per my requirement I have to install gem install rails -v 3.0.3

#gem install rails –v 3.0.3 –no-ri –no-rdoc

Now install rmagick gem

#gem install rmagick –no-ri –no-rdoc

If you will get any error, depending on mine I have to install libmagickwand-dev

#apt-get install libmagickwand-dev

Now again try to install rmagick gem:

#gem install rmagick –no-ri –no-rdoc

Now install sqlite3-ruby gem

#gem install sqlite3-ruby –no-ri –no-rdoc

Now install clearance gem

#gem install clearance –no-ri –no-rdoc

Enable apache modes

#a2enmode rewrite

#a2enmode proxy

Now install Passenger

#apt-get install apache2-dev libapr1-dev libaprutil1-de

#apt-get install libcurl4-openssl-dev

#gem install passenger –no-ri –no-rdoc

Consult Passenger Howto from NOC Pearl. 

Now install apache2 module through passenger

#passenger-install-apache2-module

Advertisements