0

I am currently learning how to use Ruby on Rails.

My local machine (Mac OS X Mavericks) is running Ruby 2.1.0 and Rails 4.

In order to follow a tutorial, I need it to run Ruby 1.9.3 and Rails 3.2.

However, I do not want to downgrade my whole machine, but only the directory of the tutorial project.

All my project are located in Desktop > work and the project I would like to set up the specific environment is located in Desktop > work > project_name

I tried to install RVM and use .rvmrc project files, as described here, but could not achieve my goal.

What is the correct, step by step, workflow to set a project specific Ruby on Rails environment, in a given directory?

Thibaud Clement
  • 6,607
  • 10
  • 50
  • 103

1 Answers1

0

Add this to your gem file:

ruby "1.9.3"
gem 'rails', '3.2'

THEN

bundle install

THEN

rails s

Now your environment will work as specify.

SNEH PANDYA
  • 797
  • 7
  • 22
  • Thank you very much for your reply. I do know how to modify the Gem file, but then, what about dependents? I mean, when I am going to add a new Gem, how can I make sure that it will work with my local versions? – Thibaud Clement May 10 '14 at 18:17
  • adding this your environment will rails 3.2 and if some gems will not work then it will show error message , its not a big deal – SNEH PANDYA May 11 '14 at 06:10
  • Correct. I actually had other [other versioning problems](http://stackoverflow.com/questions/23599904/ruby-on-rails-mac-osx-mavericks-issues-after-rvm-install?noredirect=1#comment36227399_23599904) that are now solved. – Thibaud Clement May 12 '14 at 04:28