Instant Rails is a single-install environment for Windows that includes the parts you need to get started building Rails applications. Installing it is trivial. Get the latest version from http://instantrails.rubyforge.org/wiki/wiki.pl and unzip the file wherever youâd like it to go. There is no real install program.
Once youâve unzipped Instant Rails, you can start to develop your Rails application by opening InstantRails.exe. Youâll see the basic screen shown in Figure 1-6.
Warning
If youâre running Windows Vista, you may get a warning that âThe publisher could not be verified.â If you want to run Instant Rails, youâll need to click the Run button. (To turn off the warning, uncheck the âAlways ask before opening this fileâ box.)
You may also get a warning about Apache or Ruby also being blocked from accepting incoming network requests. Youâll have to unblock those, too.
To create a new application, click on the âIâ button to the left of the Apache button, and choose Rails Applications and then Manage Rails Applicationsâ¦. Youâll see Figure 1-7, the dialog for managing Rails applications, appear.
To create a new Rails application (beyond the samples that come with Instant Rails), click on the Create New Rails App⦠button at the lower left of Figure 1-7. You might expect to get a dialog box, but surprise! Youâll get something like Figure 1-8.
To create a new Rails application here, just type rails hello
at the command line. As youâll see
in the next section, Rails will let you know itâs created a lot of
files.
To actually start the application, youâll need to go back to the Rails Applications dialog, click Refresh List, and then check your hello application as shown in Figure 1-9.
If you click on Start with Mongrel, another command-line window will open, and the Mongrel web server will start running on port 3000. To see what itâs running, open a web browser and visit http://localhost:3000/. Youâll see the advice given in Figure 1-10.
From here, you can proceed with customizing the hello project so that it actually does something. Most of your work will be in the text editor or IDE of your choice, along with the command line. To get to the command line to work more with Rails, youâll want to click the âIâ on the main Instant Rails dialog box again, and choose Rails Applications and Open Ruby Console Window. To get to the files in your applications, choose Rails Applications and Open Windows Explorer.
Warning
You canât just open a normal command-prompt window, since Instant Railsâ all-in-one approach leaves the normal âDOS boxâ knowing nothing about Rails. Any time that you want to connect with your Ruby application from the command line, you must go through Instant Railsâ Open Ruby Console Window button.
You can upgrade gem-based components within Instant Rails using
gem install rails
at its command
line. For more detailed information on upgrading the version of Rails
inside Instant Rails to the current version, visit http://excursionsonrails.com/.
Get Learning Rails now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.