I played around with Ruby on Rails and wanted to set up a developer environment with Rails server and Ruby, but didn’t find any straight forward and easy guides, so I wrote one instead. Following this guide you’ll get going developing and running Ruby in 10 minutes.
Download RubyInstaller and Dev kit from http://rubyinstaller.org/downloads/
If you run 64 bit, remember to get the 64 bit version of both Ruby and dev kit.
Install Rubyinstaller to C:\Ruby
Check “Install Tcl/Tk support”, “Add Ruby executables to your PATH” and “Assosiacte .rb and .rbw files with this Ruby installation”.
Extract Dev kit to C:\Ruby\DevKit
Open Command Prompt and CD to C:\Ruby\DevKit
[shell]ruby dk.rb init[/shell]
Open C:\Ruby\DevKit\config.yml and ensure your Ruby location is included. It’s important that you have a “-” before the path like in the example. Save the file and go back to your Command Prompt.
[shell]ruby dk.rb install[/shell]
[shell]gem install rails –no-rdoc –no-ri[/shell]
Create the directory C:\RubyApps
CD to C:\RubyApps
[shell]rails new my_app[/shell]
If you installed the 64 bit version of Ruby, open C:\RubyApps\my_app\Gemfile and replace the tzinfo-data line with:
[xml]gem ‘tzinfo-data’, platforms: [:x64_mingw, :mingw, :mswin][/xml]
. Save the file and return to Command Prompt
CD to C:\RubyApps\my_app
You are now done and can run your Rails server
Open up a browser and go to:
That’s it. Your rails server is running in the Command Prompt window which is handy for development. There are many ways to make Rails run as a Windows Service, in Apache, IIS, etc. Google it if needed. :)
To get started developing your first Ruby application, I highly recommend this guide by Andrea Pavoni.