Posts Tagged ‘MacOS X’

Installing Memcache on Snow Leopard

October 14th, 2009

Memcache is a great way to store session data in Rails.  It is easy to install on Linux (sudo apt-get install memcached), but how about on Mac OS Snow Leopard?  Follow these directions and you should be up and going:

$ curl -O http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz
$ tar xzvf libevent-1.4.12-stable.tar.gz
$ cd libevent-1.4.12-stable
$ ./configure
$ make
$ make verify
$ sudo make install
$ curl -O http://memcached.googlecode.com/files/memcached-1.4.1.tar.gz
$ tar xzvf memcached-1.4.1.tar.gz
$ cd memcached-1.4.1
$ ./configure
$ make
$ make test
$ sudo make install
$ memcached -d -P pidfile -l 127.0.0.1

webOS on Mac OS X

July 25th, 2009

webOS is here!  If you’re unfamiliar with the term, it’s the name of the development platform that powers the Palm Pre.  Unlike the iPhone (which requires esoteric knowledge of Objective-C and Cocoa), webOS uses web technologies like JavaScript/Prototype, CSS and HTML5.  This makes it really easy for web developers to pick up and develop on the phone.

The only snag I’ve run into on my MacBook Pro is that the novacom service isn’t started automatically when you launch the emulator.

This error message greets you when you first run the Palm emulator.

This error message greets you when you first run the Palm emulator.

The problem is the service/daemon that the emulator depends on has some wonky permissions, well technically they’re called ‘dubious’.  So they get refused when the installer script does its clean up.  You can start the daemon manually with /opt/bin/novacomd — but that gets annoying after a while.  So to fix it you simply need to enter the following two commands in your terminal:

sudo chmod 644 /Library/LaunchDaemons/com.palm.novacomd
sudo /opt/nova/bin/post-install.sh
$ sudo chmod 644 /Library/LaunchDaemons/com.palm.novacomd
$ sudo /opt/nova/bin/post-install.sh

The first line repairs the permissions so MacOS X doesn’t complain about any dubious looking files when you attempt to add them to launchctrl.  (The root of the issue is the com.palm.novacomd cannot have write permissions for the group, which it does post-install!)  The second command just re-executes the post-install script, and properly installs the service .

Now when you reboot your Mac you don’t need to remember to start-up any daemons before you begin development.  Enjoy!

Running TextMate, Terminal and the Mojo SDK (running VirtualBox) with the Palm Inspector

Running TextMate, Terminal and the Mojo SDK (running VirtualBox) with the Palm Inspector

You can learn more about how to get started developing below:

http://developer.palm.com

http://www.youtube.com/watch?v=YXS3SQauwPE (O’Reilly video)

Keeping Sanity with /usr/local

November 23rd, 2008

I sometimes get annoyed by the way Apple does some things non-standard.  Their use of the .frameworks folders and burying stuff 8-10 folders deep inside the /Library/System folder can make any developer pull out their hair.  If you use Rubygems you’ll find that updating sometimes can cause things to break (especially if you go to 1.3.1).

After a very frustrating experience this weekend, updating to Rails 2.2, I ran across a post by Dan Benjamin about using /usr/local.  He’s apparently quite religious about the topic, and I think he’s got another convert.  Read on and I’ll explain how I did it (there were a few snags I ran into), and how now I’m enjoying the benefits.  I highly suggest folks who find updating software on thier own machines a frustrating effort take a read.

My Rigs

May 18th, 2008

I believe it is important to choose the best tools to getting the job done. Ideally you want to optimize around a set of tools that enables you to perform tasks as efficiently as possible.

Is it possible to hammer a nail with a screwdriver? Probably, but it’s definitely not the best tool for that job.

My 20" iMac primary machine for work and play

My 20" iMac primary machine for work and play

When it comes to computers in general I believe the Mac is the best way to go. I have grown tired of Windows and its bloated OS. Mac OS X is Unix-based and I’m most comfortable in that environment. It isn’t to say I haven’t used Windows (I’m quite proficient at using a Windows-based computer). I just simply choose not to use one.
My MacBook Pro

* 2.5 GHz
* 2G of RAM
* 200GB Hard Disk
* 15” glossy display

My iMac

* 2.4 GHz
* 2G of RAM
* 210GB Hard Disk
* 20” glossy display

I’m a big fan of the glossy displays. I enjoy the high-contrast output they provide as it makes text much easier to read, imho.

In terms of software Mac OS X Leopard comes with Ruby, Rails, Mongrel, Capistrano, and a bunch of other cool gems out-of-box. It is simply just a matter of doing a sudo gem update to update all your gems to the latest versions. In addition to the out-of-box stuff I also use:

* TextMate – to edit my code
* Transmit – for FTP/SFTP/SCP
* Syncro SVN – my SVN client
* Fireworks 8 – graphics editing

A typical development session I’ll have 3 or more terminal windows open (usually one running script/server, another script/console, and the last one used to send commands to generate stuff in Rails). Safari or Firefox to preview stuff. I also run VMWare with Windows XP to test out my development layouts on Windows IE7 and Firefox.