Agile Web Development with Rails

Beginne am Anfang
                                        

If you�fre using Windows for development, you�fre in luck, because Curt Hibbs has put together a bundle of everything you�fll need to get started with Rails. InstantRails is a singledownload that containsRuby,Rails,MySQL(version4 atthetime of writing), and allthegubbins neededto makethem worktogether. It even contains an Apache web server and the support code that lets you deployhigh-performance web applications.

1.

Create a folder to contain the InstantRails installation. The path to the folder cannot contain any spaces (so C:\Program Files would be a poor choice).

2.

VisittheInstantRailswebsite2 andfollowthelink todownload thelatest .zip .le.(It�fs about50MB, so make apot of teabefore startingifyou�fre on a slow connection.)Putitinto thedirectoryyou createdin step1.

3.

You�fllneedtounzipthearchiveifyoursystemdoesn�ftdoit automatically.

4.

Navigate to the InstantRails directory, and startInstantRails upbydouble-clicking theInstantRailsicon(it�fs thebig redI).

.

If you see a pop-up asking whether it�fs OK to regenerate con.gura-tion .les, say OK

.

If you see a security alert saying that Apache has been blocked by the .rewall, well.... We�fre not going to tell you whether to block it or unblock it. For the purposes of this book, we aren�ft going to be using Apache, so it doesn�ft matter. The safest course of action is to

2. http://instantrails.rubyforge.org/wiki/wiki.pl

Report erratum

Prepared exclusively for Jordan A. Fowler

INSTALLING ON WINDOWS

Figure3.1:InstantRails.Start aConsole

running IIS on your machine, you can unblock the port and use Apachelater.

You should see asmallInstantRailswindowappear.Youcan usethisto monitor and control Rails applications. However, we�fll be digging a little deeperthanthis, so we�fllbe using a console window.To startthis, click theIbuttonin the top-left corner of theInstantRails window(thebutton has a black I with a red dot in the lower right). From the menu, select RailsApplications...,followedby OpenRubyConsoleWindow.You should see a command windowpop up, andyou�fllbe sittingin the rails_apps directory, as shown in Figure 3.1. You can verify your versions of Ruby and Rails by typing the commands ruby -v and rails -v, respectively.

At this point, you�fre up and running. But, before you skip to the start of the next chapteryou shouldknow twoimportantfacts.

First, andmostimportant, wheneveryou wantto enter commandsin a console window, you must use a console startedfrom theInstantRails menu.Follow the sameprocedure we usedpreviously(clicking theI, and so on).Ifyoubring up a regularWindows commandprompt, stuffjust won�ft work.(Why?Because InstantRailsis self-contained.itdoesn�ftinstallitselfintoyourglobalWindows environment.That meansall theprogramsyouneed arenotbydefaultinthe Windows path. You can, with a little .ddling, add them and then use the regular command window,but theInstantRails way seemsjust as easy.)

Report erratum

Prepared exclusively for Jordan A. Fowler

INSTALLING ON MAC OS X

Second, at any time you can upgrade your version of Rails to the very latest bybringingup anInstantRails console and typing

C:\rails_apps> gem update rails --include-dependencies

Du hast das Ende der veröffentlichten Teile erreicht.

⏰ Letzte Aktualisierung: Mar 22, 2008 ⏰

Füge diese Geschichte zu deiner Bibliothek hinzu, um über neue Kapitel informiert zu werden!

Agile Web Development with RailsWo Geschichten leben. Entdecke jetzt