“Five quick steps to set up RVM with rails 2 and rails3 “

rails, Uncategorized

1 – Installing RVM


$ sudo gem install rvm  <br /><br />$ rvm-install  <br />


Finally put this lines in your .bash_profile or .bashrc:


  if [[ -s $HOME/.rvm/scripts/rvm ]] ; then<br />          source $HOME/.rvm/scripts/rvm<br />  fi<br />


Restart your terminal, Rvm should be working by now.


2 – Installing ruby inside your rvm


$ rvm install 1.8.7<br />


Will install ruby 1.8.7


$ rvm install ruby-head<br />


Will install ruby 1.9.2 or newer.


3 – Setting up rvm to use your specific ruby version


$ rvm use 1.8.7<br />


To use just this time.


$ rvm use 1.8.7 --default<br />


To use always this version.


If you are using any other ruby replace the “1.8.7” for your version.


4 – Installing rails 2 and rails 3 RC inside different gemsets


You can separate your rails versions inside gemsets:


Rails 2:


Create the gemset:


$ rvm gemset create rails2<br />


Setting up rvm to use always this gemset:


$ rvm use 1.8.7@rails2 --default<br />


Installing rails 2:


$ gem install rails<br />


Rails 3:


Create the gemset:


$ rvm gemset create rails3<br />


Setting up rvm to use always this gemset:


$rvm use 1.8.7@rails3 --default<br />


Installing rails 3:


$ gem install rails --pre<br />


5 – Switching between different rails versions


Switching to rails 2:


$ rvm use 1.8.7@rails2<br />$ rails -v<br />Rails 2.3.5<br />


Switching to rails 3:


$ rvm use 1.8.7@rails3<br />$ rails -v<br />Rails 3.0.0.rc<br />
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s