Cuelogic Blog Icon
Cuelogic Career Icon
Home > Blog > All > How to Install Rails on Windows

How to Install Rails on Windows

Here are some simple and basic steps to install RoR on Windows.

 

Step 1: Ruby Installation
1) Download the rubyinstaller to install the  version of ruby http://rubyinstaller.org/downloads/

The latest version of ruby is 2.0 but it has issues with Windows, so I prefer to go with 1.9.3

You can download from here

http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-1.9.3-p484.exe?direct

2) After installation you can verify using following command

ruby -v

This will give information with version installed

 

Step 2: Rails on Windows

For that I have followed simple method using devkit installation
1) Here is the link for devkit installation

https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

It will take near about 10-15 minutes depending on Internet speed as well

2) Once devkit has been installed, navigate to that path from console

3) Initialise dev kit from following command

ruby dk.rb init

It will automatically create config.yml with your ruby path, open that and confirm the path.

4) Finally, Type following command on console

ruby dk.rb install

This step installs (or updates) an operating_system.rb file into the relevant directory needed to implement a RubyGems.

You may need to use  –force option to update this file.
That’s it. You have installed rails as well.

 

How to create new app:

You can create new app using following command

rails new appname

for example:”rails new helloworld”

This will actual create default Framework directory structure under specified path with default database will be sqlite.


How to test program on browser

Type following command on console to open server version

rails s

Default port is 3000

so you can use following command in browser

http://localhost:3000

for switching to console mode use below command

 rails c