RailsInstaller with ruby 1.9.2

UPDATE: RailsInstaller 2 has been released. It include ruby 1.9.2 and rails 3.1, read it here and download it here.

Railsinstaller from railsinstaller.org ships with ruby 1.8.7 by default, but if you want to use ruby 1.9.2, these steps might help you out.

  1. Download and install railsinstaller (default to C:\RailsInstaller, lets call this ROOT_DIR)
  2. Download and install Ruby 1.9.2 from rubyinstaller.org (railsinstaller only compatible with ruby from rubyinstaller.org) to ROOT_DIR\ruby192
  3. Edit file setup_environment.bat on ROOT_DIR\ruby1.8.7 (you can use notepad or notepad++)
  4. On line 12 in setup_environment.bat, change it to: SET RUBY_DIR=C:\RailsInstaller\Ruby192
  5. On line 27 change the line to: SET PATH=%RUBY_DIR%\bin;%RUBY_DIR%lib\ruby\gems\1.9.1\bin;%ROOT_DIR%\DevKit\bin;%ROOT_DIR%\Git\cmd;%PATH%
  6. Save the file
  7. Open railsinstaller console from Start menu and make sure the loaded ruby version is 1.9.2 by running ‘ruby -v’ command on the console
  8. Still on the console, go to devkit folder on ROOT_DIR\DevKit by running ‘cd C:\RailsInstaller\DevKit’ command
  9. Inside the devkit folder run ‘ruby dk.rb init’
  10. Still inside the devkit folder, run the ‘ruby dk.rb install –force’ command (note the 2 dash before force)
  11. If nothing went wrong then you should be able to install the various ruby gems that’s available out there (Ex. gem install rails).
  12. You need to install rails gem again (and any gems that you want to use) because the default rails gem that come with railsinstaller is on the ruby 1.8.7 folder while now you’ll be using the gems in the ruby192 folder.

And that’s it, now you can enjoy railsinstaller with ruby 1.9.2 :D

Advertisements

3 thoughts on “RailsInstaller with ruby 1.9.2

  1. Hi,
    first of all thank you very much for the instruction. It worked fine but somehow my existing Rails project wont use the new Ruby interpreter but still version 1.8.7 which came along with my RailsInstaller.

    Maybe you have any suggestion? I am using Aptana Studio 3.
    I removed the project from Aptana to import it again, but that did not fix it.

  2. Hmm, that’s strange, I tried to run my rails 2.3.11 application and it work fine using ruby 1.9. I even delete the ruby1.8.7 folder and it still work.

    Did you run it from rails installer console? if you using aptana maybe you should check aptana’s documentation on how to set which ruby it uses to run you app.

  3. You’re right, if I’m using the RailsInstaller console typing ruby -v it returns “1.9.2”. Also if I’m switching within that console to my app directory and run “rails s” everything works fine – so it’s actually a problem with Aptana Studio.
    If I find a solution I will let you know.

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