Mac OS X

Mac OS X is advertised by Apple as the world’s most advanced Operating System. It’s not an unreasonable boast. If you’re just starting out with a Mac then I highly recommend David Pogue’s book, Mac OS X: The Missing Manual (published by O’Reilly).

I’ve been interested in Macs for a long time, but only decided to buy one when I saw the first creating a blog in 15 minutes screencast that was put together to demonstrate Ruby on Rails. The screencast showcased the TextMate editor (which only runs on Mac OS), and I just had to try it out. I now own three Macs, which undoubtedly makes TextMate one of the most expensive things that I’ve ever bought…

Articles on Mac OS X

Installing Nokogiri on Leopard

Nokogiri complains that the version of libxml2 installed on Mac OS X Leopard is over 4 years out of date. Well we can’t have that now can we!

Update your libxml2 library

Installing the pg PostgreSQL gem on Mac

You can connect to a PostgreSQL database from Ruby using the pg gem, but if the pg_config program isn’t in your path you’ll run into problems during installation.

This article is mainly here to provide some Google juice for those who hit the same problem…

Compiling the pg gem

Building do_mysql on a 64-bit Mac

Whilst installing merb with edgy I’ve had run into some trouble building the do_mysql gem on my Macbook Pro. It’s a 64-bit machine, so I installed the 64-bit version of MySQL, and that was my first mistake…

Find out how to compile do_mysql

Debugging JavaScript in WebKit

If you do much web development you’re probably a big fan of the Firebug plugin for Firefox. It really is a rare gem in the web developer’s arsenal. When I’m not developing I prefer to use Safari – it seems faster and leaner, so I often find that I’ve got both browsers open at once.

A couple of days ago something rather fantastic happened – Safari got a makeover…

Read about the JavaScript debugger

Removing an entry from /etc/hosts on a Mac

I was testing a freshly deployed web site for a client the other day before they’d setup their DNS entry, and added the server to my Mac’s /etc/hosts file. It looked something like this:

208.75.85.73    www.clientsite.com

When I’d finished my testing I removed the entry from /etc/hosts. On most Unix systems that’s enough to eradicate all traces of your meddling, but not on the Mac. Any IP address that you add to /etc/hosts gets cached by the operating system.

After a bit of poking around I discovered lookupd. On Tiger you can flush the cache by entering this in the terminal:

lookupd -flushcache

On Leopard the lookupd command has been replaced with dscacheutil:

dscacheutil -flushcache

Update: The HostsWidget Dashboard widget appears to solve the same problem rather well.