1.1. Windows
We present two options for a Windows
installation of Ruby on Rails: Instant Rails and RadRails
alone and Instant Rails plus the Rad Rails IDE.
1.1.1. Instant
Rails
The easiest way to get started on Windows is to
use Instant Rails. Instant Rails (
"#rubyrails-app-a-fig-1">Figure A-1) is a one-stop Rails
runtime solution containing Ruby, Rails, Apache, and MySQL, all
preconfigured and ready to run. There is no installer, you simply
unzip it into the directory of your choice and run it. It does not
modify your system environment.
For more details about Instant Rails, go to the
Instant Rails home page at http://instantrails.rubyforge.org:
-
-
Make sure that the installation path (to the
directory into which you unzip the archive) does not contain any
space characters, and then start InstantRails.exe.
-
Instant Rails will detect that it is being
started from a new directory and ask whether you want to have it
update the paths in the all of the configuration files. Click
Yes.
-
Click on the "I" button (or press the Alt key
twice) to display the main menu.
That's all there is to it!
Instant Rails includes the cooksite Rails
application from the ONLamp.com article "Rolling with Ruby on
Rails" (onlamp.com/pub/a/onlamp/2005/01/20/rails.html">http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html).
The cooksite application is included as a preinstalled sample
application. There is also a version of this tutorial that was
rewritten to be specific to Instant Rails available at
http://instantrails.rubyforge.org/wiki/wiki.pl?Rolling_With_Ruby_On_Instant_Rails_Tutorial.
Instant Rails also includes the Photo Share application from this
site.
Instant Rails includes the Apache web server,
which you won't use until later in the development of a Rails
application, when you want to more closely duplicate your final
deployment environment. During development, it is easiest use
Ruby's built-in web server, WEBrick, or the new Ruby Mongrel
server.
So, for example, to run the cooksite
application, execute the Instant Rails menu command Rails
Applications Manage Rails
Applications..., select the checkbox next to the cooksite
application, and press the "Start with WEBrick" button. When you
browse to http://127.0.0.1:3000/, you will see
the cooksite application.
Instant Rails includes the One-Click Ruby
Installer for Windows for its Ruby interpreter, which includes the
SciTE text editor with full Ruby syntax highlighting. After
installing Instant Rails, you can find the SciTE executable at
InstantRails/ruby/scite/SciTE.exe.
1.1.2.
RadRails
If you want more than a simple text editor, then
try out the excellent RadRails IDE. RadRails (Figure A-2) is an Eclipse plug-in
and is available as both a standalone IDE (Eclipse with the plug-in
preinstalled) and as a standard Eclipse plug-in at http://www.radrails.org. With
RadRails, you get a full IDE, complete with an integrated GUI
debugger.
After you install RadRails, you have to
configure it to work with your Instant Rails installation:
-
Execute the menu command Window Preferences.
-
Select Ruby Installed Interpreters.
-
Click the Add button, and give the new
interpreter instance a name (like "Instant Rails Ruby"); browse to
the Ruby executable at InstantRails/ruby/bin/ruby.exe, and click
OK.
-
While still in the preferences dialog, select
Ruby->Ri/rdoc and set the Rdoc and Ri paths to InstantRails/ruby/bin/rdoc and InstantRails/ruby/bin/ri, respectively. This
step lets you use the built-in documentation features of
RadRails.
You can create a new skeleton Rails application
via the menus with File
New... Rails RailsProject. |