Can I install Ruby on Rails 2.x and Ruby on Rails 3 side by side

I have Ubuntu rails enviroment for playing with ROR. I am running Rails 2.3.8 now.

I want to look into the rails 3. Is it possible to run both dev environments side by side? If not, how to clean the 2.x rails system for installing rails 3? Or do I need to set up a brand new Ubuntu machine?

Any help, links ... pointers would be great!

+7
ruby-on-rails ubuntu ruby-on-rails-3
source share
2 answers

I would highly recommend Ruby Version Manager (rvm) - see this railscast for more information. This allows you to easily manage different versions of Ruby on one computer. I believe that this should also allow you to separate different versions of Rails from each other and allow you to switch between them easily - see this example from http://rvm.beginrescueend.com/gemsets/basics/ :

rvm 1.9.2-head gem install rails -v 2.3.3 rvm gemset create rails222 rails126 Gemset 'rails222' created. Gemset 'rails126' created. rvm 1.9.2-head@rails222 gem install rails -v 2.2.2 rvm 1.9.2-head@rails126 gem install rails -v 1.2.6 

Hope this helps!

+5
source share

For Windows users :

(I understand that the crawler uses Ubuntu, but it appeared in SERP when I had a question related to Windows.)

You will find that rvm is not an option. You can use pik , however:

 -- install the gem > gem install pik -- run 'install' command to add the utility to your system > pik_install [some dir in your PATH variable] -- tell pik where your Ruby versions are > pik add C:\Ruby187\bin > pik add C:\Ruby193\bin -- see which versions pik has under control and which one is actively being used > pik list * 187: ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32] 193: ruby 1.9.3p194 (2012-04-20) [i386-mingw32] -- tell pik to use a different version > pik use 193 > pik list 187: ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32] * 193: ruby 1.9.3p194 (2012-04-20) [i386-mingw32] -- confirm the change worked: > ruby -v && rails -v ruby 1.9.3p194 (2012-04-20) [i386-mingw32] Rails 3.2.3 
+1
source share

All Articles