During my previous attempt to install Ruby on Rails on Windows 8 I ran into a couple of issues. I decided to try again with the latest and greatest and see what happens.
First of all, this time I managed to install Ruby 2 (ruby 2.0.0p247 to be exact) and Rails 4 with no particular problems on:
- Windows 8 32 bit
- Windows 8 64 bit
Last time this wasn't possible at all and I had to use an older version, so good news here.
For Windows, the steps are the same:
- Use RubyInstaller
- Update local gems and update gem itself
- Install the sqlite3 gem first to see if that goes ok
- Install the rails gem (it will take some time)
- The problem with ExecJS is still present and it is solved as I described on my previous post for both 32 and 64 bits
- One extra problem for Windows 64 bits: for some reason, while it installs the 64bit sqlite3 gem, it declares the 32bit gem in the rails
Gemfile.lock. Just edit that file, find the line that mentions the sqlite gem and change x86 to x64. In my case I had to change
sqlite3 (1.3.8-x64-mingw32). Make sure that's actually the version on your system by running
gem list --local.
That should be enough to get you up and running the hello world Ruby on Rails application that is generated by
rails new demoapp.
For Ubuntu and Mac, things are simpler. I used rvm. I had never used it before and it's amazing. I can install any ruby version I want, I can maintain multiple versions, it's perfect. For Ubuntu in particular, Ubuntu's gem doesn't really permit you to update it. It gives some warning that Debian based systems should only update through the package manager and quits… so rvm comes in very handy to just install it on a user level and code happily without risking polluting or damaging the system. No other weird issues there, after all it seems that the Ruby community is mostly using Mac and Linux so I wouldn't expect to find any problems here.
Note that there is a tool similar to rvm for Windows, called pik, but I couldn't get it to work at all. I also tried rvm using cygwin but that also failed miserably so I wouldn't recommend either of these approaches. Just use the RubyInstaller on Windows and it should work fine.