Tuesday, February 23, 2016

How to install Ruby on Rails on Windows

Downloading

Fetch the latest version of the following packages for your architecture and platform:


Installing

Git Bash

Run the installer. You might want to uncheck all options like file associations, icons and Windows integration. Leave Use Git from Git Bash only selected. Mark Checkout as-is, commit Unix-style line endings. Check Use Windows' default console window. Finish it.

RubyInstaller

Just run the installer and I highly recommend installing it under your user directory, more precisely under AppData\Local. Make sure you check the option to add Ruby to your path.

DevKit

Run the self-extractor and place it under lib\devkit, under the chosen path for the Ruby installation above. Open Git Bash, cd to the devkit directory, then issue the following command:

ruby dk.rb init && ruby dk.rb install

Rails

Still on Git Bash, issue the following command:

gem install rails --no-ri --no-rdoc

Testing

After installing Rails, the easiest way to test your setup is creating a new Rails application and running it. For that, you can issue the following commands:

rails new test1
cd test1
rails s

Now go to your browser and point it to http://localhost:3000/

Done!