Section 1.1. Windows


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 (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.

Figure A-1. Instant Rails

For more details about Instant Rails, go to the Instant Rails home page at http://instantrails. rubyforge .org:

  1. Download and unzip the latest version of the Instant Rails ZIP file from: http://rubyforge.org/frs/?group_id=904.

  2. 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 .

  3. 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.

  4. 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 cookbook Rails application from the ONLamp.com article "Rolling with Ruby on Rails" (http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html). The cookbook 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 book.

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 cookbook application, execute the Instant Rails menu command Rails Applications Manage Rails Applications..., select the checkbox next to the cookbook application, and press the "Start with WEBrick button. When you browse to http://127.0.0.1:3000/, you will see the cookbook 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.

Figure A-2. RadRails

After you install RadRails, you have to configure it to work with your Instant Rails installation:

  1. Execute the menu command Window Preferences.

  2. Installed Interpreters.
  3. InstantRails/ruby/bin/ruby.exe, and click OK.
  4. 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.



Ruby on Rails[c] Up and Running
Ruby on Rails[c] Up and Running
ISBN: B003D3OGCY
EAN: N/A
Year: 2006
Pages: 94

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net