Low End Mac Reader Specials
Memory To Go Special: MacPro 8 Core 8GB kit $232 / 4GB kit $116 / 2GB kit $72. New Macbook 2GB DDR3-$65. HARD DRIVES available -- Free shipping / LIfetime warranty.
Download Typestyler, still the Ultimate Styling Tool for Internet, Print and Video Graphics. Works great in Classic with a Native OS X Version on the way. Free Tryout: www.typestyler.com
LA Computer Company: Specials on AppleCare, iMac's, MacBook Pros and more. Optical Drives for Apple iBooks, Powerbooks, MacBooks, MacBook Pros in Stock. Call 1-800-941-7654 Click Here.
OWC: Premium Memory for Mac without the Premium Price. DDR2 4GB from $47.99, DDR3 4GB for Unibody $79.99, Mac Pro 4GB $97.99. Expert Support, Free Installation Videos & Guides. www.MacSales.com
Don't install Parallels to play poker online! Poker Mac will show you how
to download and install a native Mac poker application such as Full
Tilt Poker Mac.
Laptop Hardware Provided by TechRestore - Overnight Mac & iPod Repairs.
Compare products like desktop computers, apple laptops, apple macs, and LCD Monitors side by side! All the information and reviews to make the best purchasing decision for new mobile phones, sat nav systems, or MP3 players. The Ciao online shopping community makes searching products easy for you.
Linux to Mac
Installing Ruby on Rails and PostgreSQL on Leopard
- 2008.02.15 - Tip Jar
Popularity: ![]()
![]()
![]()
![]()
![]()
Setting up a development environment with Ruby on Rails and the PostgreSQL database on Leopard is straightforward. In an interesting twist, the hard part of setting up Rails and PostgreSQL on OS X 10.5 "Leopard" is easy with Linux, and the easy part is hard with Linux.
Rails, the Easy Part
If you haven't heard, Ruby on Rails is a web development framework created by David Heinemeier Hansson that uses the Model-View-Controller (MVC) design pattern for separating business logic from the presentation details. The MVC approach is very popular in enterprise class systems.
Apple recognized the momentum behind Rails and includes a basic configuration by default. The Ruby language (1.8.6) is installed along with the Rails (1.2.3) framework. In addition to the Ruby language and Rails, OS X Leopard includes a number of useful supporting packages (called Ruby Gems). This saves you the setup time for the basic infrastructure that is required on most Linux distributions.
PostgreSQL, the Hard Part
In order to get the PostgreSQL database up and running on Leopard, use MacPorts to install it. To use MacPorts, you first need to install the X-code tools from the Leopard DVD. It's an optional install, but you need the compiler and supporting libraries to compile and install PostgreSQL. (Most Linux distributions have precompiled PostgreSQL packages ready to install with one command, making this part of the set up easier on Linux.)
Once MacPorts is installed, install PostgreSQL with:
sudo port install postgresql83
It takes quite a while for MacPorts to download and compile PostgreSQL. It took about 90 minutes for me. After it's installed, there are a couple of post install commands that need to be run so that it starts automatically at boot time. The commands are described in detail once MacPorts finishes the basic installation.
Install the Ruby PostgreSQL Driver
In a production environment, you need the latest native PostgreSQL binary driver. I tried a couple of times to install the binary driver on my iBook, but I kept getting compile errors. I got around the problem by installing the "pure ruby" driver (indicated by the -pr suffix):
sudo gem install postgres-pr
I haven't noticed a performance issue during development, but I would not feel comfortable using it for a production application.
Telling Rails to Use PostgreSQL
The final step after starting a new Rails application is to modify the "config/database.yml" file to tell Rails to use PostgreSQL. Here is an example:
development: adapter: postgresql database: keithw username: keithw
Having Ruby and the basic Rails environment available out of the box
is a huge plus for OS X Leopard.
Keith Winston is a recent Mac convert after five years of Linux on the desktop. He also writes for Linux.com and recently created CommandLineMac.com to focus on the Unix-y power of the Mac. If you find Keith's articles helpful, please consider making a donation to his tip jar.
Recent Linux to Mac Columns
- Introduction to Autofs in Mac OS X, 07.01. "Autofs is often used in enterprise environments to set up network-based home directories and other network mounts for users at login."
- Automating FTP on the Mac, 03.04. There's no shortage of GUI FTP programs, but using the Terminal gives you tools to automate file transfer sessions.
- An RSS News Reader with the Power of Google, 08.20. Unlike browser-based RSS readers or dedicated news reader apps, Google Reader lets you access your favorite feeds from any computer and browser.
- 3 reasons to run virtualized Linux, 05.22. Reasons to run Linux under virtualization include duplicating your development environment, X11 programs that don't work well in OS X, and exploring different GUI concepts.
- More in the Linux to Mac index.
Links for the Day
- Mac of the Day: Clamshell iBook G3/300 MHz, Sep. 1999 - innovative, rugged, heavy, clamshell laptop introduced AirPort and was a huge hit.
- Group of the Day: G-Books is for G3 PowerBooks and iBooks.
- July 4 in LEM history: 00: When Randy met Mac - 08: Wouldn't life be great with an iSlate? - Mac Pro overclocking, Windependence with Darwine, Blu-ray for Macs, and more
- Support Low End Mac
Recent Content on Low End Mac
- iPhone 3GS Overheating, Battery Life App, 240 GB Upgrade for 5G iPod, Total Baby App, and More, iNews Review, 07.02. Also low cost international calls, U-verse remote DVR control, Sync Blocker USB-to-Dock cable, Rocket Taxi improved, and more.
- MacBooks Top Amazon Sales, EFI 1.7 Problems, Pros and Cons of Built-in Batteries, and More, The 'Book Review, 07.02. Also make a bootable SD Card, Leopard on a 9" Dell netbook, MacBook Pro and Air reviews, triple WiFi range, bargain 'Books from $179 to $2,300, and more.
- Apple Tops in Satisfaction Again, Slim Profits on Mac mini, Ultimate Photo Setup, and More, Mac News Review, 07.02. Also tips for cloning hard drives and moving files from old Macs, Clickfree Transformer turns USB drive into a backup drive, maximum Mac Pro RAM, and more.
- Refurb MacBook Pro Deal, Fastest Mac Browser, 256 MB Modules for WallStreet, and More, Charles W. Moore, Miscellaneous Ramblings, 07.01. Also more Safari 4 feedback, praise for Camino, MacBook cracks, looking for Craigslist software for Macs, and more.
- Amazon.com v. Interstate Sales Tax: Everyone Loses, Dan Knight, Mac Musings, 07.01. Amazon.com is standing up to states that are trying to have it collect sales tax on interstate commerce, which most see as a violation of federal law.
- Optimized Software Builds Bring Out the Best in Your Mac, Dan Knight, Online Tech Journal, 06.30. Applications compiled for your Mac's CPU can load more quickly and run faster than ones compiled for universal use.
- Checking Out Safari 4 on an Old PowerBook, Charles W. Moore, 'Book Value, 06.30. Safari 4 is the fastest it's ever been, but it's not without some frustrating drawbacks.
- Intel's Promise Fulfilled: More Processing Power per Processor Cycle, Dan Knight, Mac Musings, 06.30. Apple promised improved CPU efficiencies when it announced the move to Intel in 2005. Three years of MacBooks show the progress.
- Is Steve Jobs' Health Essential to Apple's Future?, Frank Fox, Stop the Noiz, 06.30. Steve Jobs' health is an important thing, but Apple has demonstrated that it can be profitable without him.
- More links in our archive.
Recent Deals
- Best Mac Pro Deals, 07.02. Used 3 GHz 4-core, $2,000; 3.2 8-core, $2,900; refurb 2.8 8-core, $2,399; new 2.66 4-core, $2,290 a/r; 2.26 8-core, $3,070 a/r; 2.66, $4,499; more.
- Best Mac OS X 10.4 'Tiger' Deals, 07.02. Full version DVD, $140; 5 user family pack, $370; 10-user Server, $299.
- Best 17" PowerBook G4 Deals, 07.02. Used 17" 1 GHz PowerBook, $689; 1.67 GHz, $749; hi-res, $1,029.
- Best Xserve Deals, 07.02. Used 2 GHz single G5, $800; dual, $1,000; refurb 2.8 GHz 4-core Xeon, $2,100; new 2.26 4-core Nehalem, $2,888; 8-core, $3,449; 2.66, $4,799; 2.93, $5,999.
- Best iPod touch Deals, 07.01. Refurb 2G/8 GB, $179; 16 GB, $259; iG/32 GB, $279; new 2G/8 GB, $215; 1G 16 GB, $210; 2G, $275; 2G/32 GB, $369. Prices include shipping.
- Best 13" MacBook & MacBook Pro Deals, 07.01. Used 1.83 GHz, $595; 2.0, $629; new 2.0, $889; 2.13, $925 after rebate; refurb 2.0 Unibody, $949; 2.4, $1,099; new 2.26 MBP, $1,119 a/r; more.
- Best 12" PowerBook G4 Deals, 07.01. Used 867 MHz Combo, $400; 1.33 GHz, $448; 1.5 GHz, $599; 1 GHz SuperDrive, $509; 1.33 GHz, $599; 1.5 GHz SD, $679.
- Best Apple TV Deals, 07.01. Refurb 40 GB Apple TV, $199; new, $220; refurb 160 GB, $279; new, $320. Prices include ground shipping.
- Best G4 iBook Deals, 06.29. Used 12" 800 MHz Combo, $290; 1 GHz CD, $299; Combo, $370; 1.33 GHz, $428; 14" 1 GHz Combo, $399; 1.2, $465; 1.42 GHz, $500.
- Best Mac OS X 10.0-10.3 Deals, 06.29. Mac OS X 10.0, $30; 10.1, $20; 10.2, $60; 10.3, $50; 10.3 Server, unlimited users, $130.
- Best Power Mac G3 and PCI Video Card Deals, 06.29. Used beige 300 MHz, $25; G4/366, $39; blue & white 350, $80; 400, $90; 450, $105; PCI video cards from $15; shipping additional.
- Best Time Capsule and AirPort Deals, 06.29. Close-out 500 GB Time Capsule, $199; 1 TB, $350; AirPort Extreme Base Station, $130; refurb AirPort Express, $85.
- More deals in our archive.
About LEM | Support | Usage | Privacy | Contacts
Navigation
Used Mac Dealers
Apple History
Video Cards
Email Lists
Favorite Sites
MacSurfer
MacMinute
MacInTouch
MyAppleMenu
InfoMac
Macs Only!
The Mac Observer
Accelerate Your Mac
RetroMacCast
PB Central
MacWindows
The Vintage Mac
Museum
DealMac
DealsOnTheWeb
Mac2Sell
ramseeker
Mac Driver Museum
JAG's House
System
6 Heaven
System 7 Today
the pickle's Low-End
Mac FAQ
Abandonware
Petition
Mac vs. PC Info
Affiliates
The Apple
Store
Mac
Connection
MacMall
TechRestore
ExperCom
Crucial
Memory
batteries.com
Have a question?
Ask an expert!
Advertise
MacMinute
MacInTouch
MyAppleMenu
InfoMac
Macs Only!
The Mac Observer
Accelerate Your Mac
RetroMacCast
PB Central
MacWindows
The Vintage Mac
Museum
DealMac
DealsOnTheWeb
Mac2Sell
ramseeker
Mac Driver Museum
JAG's House
System 6 Heaven
System 7 Today
the pickle's Low-End
Mac FAQ
Abandonware
Petition
Mac vs. PC Info
Mac Connection
MacMall
TechRestore
ExperCom
Crucial Memory
batteries.com
Ask an expert!
