Install Ruby on Rails on a PC

Posted by Andrew on September 16, 2010

I previously wrote a post about accepting the challenge of installing Ruby on Rails on a PC only to temporarily give up because I had bought a Mac Mini which comes with Ruby on it.  This is me picking up the challenge and beating it down!

I am running Windows 7 and I just installed the most current versions of Ruby (1.9.2) and Rails (3.0) on September 16th, 2010.  Here is what you need to do.

Installing Ruby

Go to the Ruby Forge page for the Windows Ruby Installer and choose the topmost .exe install file which at the time of this post was rubyinstaller-1.9.2-p0.exe (this installs the 1.9.2 version of the Ruby language).

Once downloaded run the install file and select the two check boxes for adding Ruby to your Path and for associating .rb and .rbw files as shown below:

Once finished installing the icons can be found in the Start menu under Ruby 1.9.2.

Double-click on the "Start Command Prompt with Ruby" icon to launch the Command Prompt. At the command prompt you do not need to change the directory since you selected the check box for putting Ruby in your Path.

Then to start the Gem Server type:

gem server

Like you see here below:

After the Server is started minimize that Command Prompt window and go back to the "Start Command Prompt with Ruby" icon under Ruby 1.9.2 and open another Command Prompt window. Then you can go to http://localhost:8808 and you should see a list of the RubyGems that are installed. I will look like the image below but with less than 28 Gems installed at this point:

Installing SQLite3

Next you should install a SQL type database.  MySQL is very popular for production environments but SQLite works great and is easy to install  for development. To install SQLite type the following at your command prompt:

gem install sqlite3-ruby

Now you should see the following:

The install tells you that you need the sqlite3.dll file to be in your C:Rubybin folder, which in this case would actually be C:Ruby192bin. To get the .dll file I didn't use the URL that is given in the image above, instead I went to and then searched for "sqlitedll". You should check here for the most recent version of the .dll file.  The most recent .dll as of this writing was found here  Unzip the file and copy the sqlite3.dll file to the C:Ruby192bin folder. Now you should be finished installing SQLite.

Installing Rails

Now, at the command prompt type:

gem install rails

For me it looked like this:

This will install the most recent version of Rails which at the time of this post is Rails 3.0.

Then to make the process of creating rails apps a little simpler to track I opened the "Andrew" folder in windows explorer and created a new folder named "RailsApps", this step is not necessary and you can name this folder whatever you like.

Now at the command prompt type:

cd RailsApps

Then type:

rails new MyFirstRailsApp

This will create a new rails app!

At the command prompt type:

cd MyFirstRailsApp

You will now be in the folder of your very first Rails app, which is where you will execute the rest of your command prompt work.

Now to start the Rails Server type:

rails server

Open a browser window and go to http://localhost:3000 and you should see something that looks like this:

You have just created a Ruby on Rails App on a Windows machine!  I am still new to the RoR world, so I may or may not be able to answer all questions related to this process but I do hope it has been helpful.