Agile Web Development with Rails

Start from the beginning
                                        

Locomotive Mac Installation

You can download Locomotive as a .dmg .le from http://locomotive.raaum.org. Mount it, and drag the Locomotive folder somewhere appropriate. Then start Locomotiveby navigatinginto thefolder and running Locomotive.app (butonly after admiring the cool trainicon).

Locomotiveletsyouimport existingRailsprojects and create newprojects.Its main window displays a list of all the Rails projects that it is managing and allows you to start and stop those applications. You edit your application�fs .les outsideLocomotive.

If you decided to peek at the Windows installation instructions, you�fll have seenthatthere�fs a strong warning: usethe console suppliedbyInstantRailsto typeRails commands.Well,the sameistruehere.When usingLocomotive,you must useits console to type commands.Accessitfrom the Applications�� Open Terminal menu option.

3.4 Installing on Linux

If you are the �gI-code-by-twiddling-the-bits-on-my-hard-drive-with-a-magnet�h kindofLinux user,thenDanBenjamin�fsinstructionsfortheMac willprobably get you going. One caveat: be wary if your box already has Ruby installed: it may not have the libraries you need. I (Dave) always install Ruby into a

Report erratum

Prepared exclusively for Jordan A. Fowler

DEVELOPMENT ENVIRONMENTS

directory under myhomedirectory(say ~/ruby)and then include ~/ruby/bin in mypath.

The rest of us mortals will probably use our distribution�fs package manager toinstall the code we need(pretty muchthe wayJamesDuncanDavidson�fs instructionsdidfortheMac).But,because eachdistributionisdifferent, we�fre going to punt on the details and instead reference an online resource that has the scoop for Ubuntu, the popular Debian-based distribution. The link here is for the �gDapper Drake�h distribution. You may .nd that this has been supercededby the timeyou read this.

.

http://wiki.rubyonrails.com/rails/pages/RailsOnUbuntuDebianTestingAndUnstable

.

http://wiki.rubyonrails.com/rails/pages/RailsOnUbuntu

3.5 Development Environments

The day-to-day business of writing Rails programs is pretty straightforward. Everyone worksdifferently;here�fshowI work.

The Command Line

I do a lot of my work at the command line. Although there are an increasing numberofGUI toolsthathelpgenerateand manageaRailsapplication,I .nd the commandlineis still the mostpowerfulplacetobe.It�fs worth spending a little while getting familiar with the command line on your operating system. Find out how to use it to edit commands that you�fre typing, how to search for and edit previous commands, and how to complete the names of .les and commands asyou type.5

Version Control

Ikeepall my workin a version control system(currentlySubversion).I make a pointof checking a newRailsprojectintoSubversion whenI createit and com-miting changes onceI�fvegotpassingtests.I normally commit to the repository many times anhour.

If you�fre working on a Rails project with other people, consider setting up a continuousintegration(CI) system.When anyone checksin changes,theCI system will check out a fresh copy of the application and run all the tests. It�fs simple insurance against you accidentally breaking stuff when you make a change. You also set up your CI system so that your customers can use it

5. So-calledtab completionisstandard onUnixshellssuch

asBash and zsh.It allowsyoutotype the.rstfewcharactersof a .lename,hit Tab,andhavetheshelllookfor and completethe name based on matching .les. This behavior is also available by default in the Windows XP command

You've reached the end of published parts.

⏰ Last updated: Mar 22, 2008 ⏰

Add this story to your Library to get notified about new parts!

Agile Web Development with RailsWhere stories live. Discover now