OK.YouWindows users aredone:you can skipforward to Section 3.5, Devel-opmentEnvironments, onpage 36.Seeyou there.
3.3 Installing on Mac OS X
As of OS X 10.4.6, Mac users have a decent Ruby installation included as standard.3 You can install Rails on top of this by installing RubyGems and theninstallingRails and adatabase.
Interestingly, though, many Mac users choose a different path. Rather than build on the built-in Ruby, either they use a prepackaged solution, such as Ryan Raaum�fs Locomotive, or they use a package management system such asMacPorts.
Although using a bundled solution such as Locomotive might seem like a no-brainer, it comes with a downside: it doesn�ft include the MySQL database. Instead,itcomes with adatabase calledSQLite.Now,SQLiteis aperfectlygood database for small applications, and this might suit you .ne. However, the examples in this book use MySQL, and most Rails sites deploy using MySQL or Postgres. Also, Locomotive runs its applications under a web server called Mongrel.Thisis .ne,butthesamplesinthisbookassumeyou�freusing some-thingcalledWEBrick.Both work.ne,butyou�fll needto adjusttheinstructions to .tMongrel�fsway of working.So,werecommend thatyouhavealook atthe �ginstall-it-yourself�hinstructionsthatfollow.If these seemtoo scary,feelfreeto installLocomotive(thedetails are on the nextpage).
Roll-Your-Own Mac Installation
Ready to roll your sleeves up and do some real installing? You came to the right place. In fact, just in case the instructions that follow seem too easy, we�fll makeit evenharderbyforcingyou to make adecision upfront.
Whatwe�fllbedoinginthis sectionisinstalling allthe software neededbyRuby andRails ontoyour system.Andthere are as many ways ofdoingthat asthere are developers on the Mac.4 Because the installation has a number of steps and because these steps to some extent depend of the version of OS X you�fre running, we�fre going to delegate the description of the installation to some write-ups on the Web. Here comes the decision: we�fve found two really good (andwell-tested)descriptions ofhow toinstallRails onyourMac.
3.
AndOSX10.5 willincludeRailsitself.
4.
More,probably,becauseIforonerarelyinstall softwarethesameway twice.
Report erratum
Prepared exclusively for Jordan A. Fowler
INSTALLING ON LINUX
The .rstcomesfromDanBenjamin.His article, BuildingRuby,Rails,LightTPD, and MySQL on Tiger, is a step-by-step guide to downloading and building all the softwareyou need to turnyourMacinto aRails machine.Findit at
. http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger
An alternative approachistoletthe computerdo some ofthelow-levelworkfor you.There are atleasttwopackage managementsystemsforOSX.Thesehan-dledownloading,dependency management,installation, and updating of soft-ware.JamesDuncanDavidsonhas agreatdescription ofhow to use theMac-Portspackage management systemtoinstallRails onOSX.(WhenDuncan wrotethis article,MacPortswas still calledDarwinPorts.)Duncan�fs approach has one real advantage:because thepackage managerhandlesdependencies, it makes it easier to upgrade and roll back versions of the individual compo-nents.Ithas one slightdisadvantage:youdelegate control ofyourinstallation layout to the package manager, so you do things the MacPorts way or not at all.Inpractice,thisisn�ft aproblem.Anyway,you�fll .ndDuncan�fswrite-up at
. http://duncandavidson.com/essay/2006/04/portsandbox
Read both through, make your choice, and then go for it. We�fll wait.... When you comeback,join us on thefollowingpagefor adiscussion of editors.
Agile Web Development with Rails
Comenzar desde el principio
