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 RubyGo to the http://rubyforge.org/frs/?group_id=167 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:
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 SQLite3Next 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:http://www.sqlite.org/download.html 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 sqlitedll-372.zip. Unzip the file and copy the sqlite3.dll file to the C:Ruby192bin folder. Now you should be finished installing SQLite.
Now, at the command prompt type:
gem install rails
For me it looked like this:
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:
rails new MyFirstRailsApp
This will create a new rails app!
At the command prompt type:
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:
Open a browser window and go to http://localhost:3000 and you should see something that looks like this: