These instructions work on OSX, most linux distros and FreeBSD You can skip ruby if you already have a good copy. But if you only have the stock ruby that comes with OSX I would compile it from source and rename the stock OSX ruby and irb to ruby.bak and irb.bak so you don't end up using them on accident.
________________________________________________________________

Get Ruby1.8.2

curl -O http://rubyforge.org/frs/download.php/2338/ruby-1.8.2.tar.gz
tar xvzf ruby-*
curl -O http://rubyforge.org/tracker/download.php/426/1698/2105/242/ruby-ssl098-patch
patch -p0 < ruby-ssl098-patch
rm ruby-ssl098-patch
cd ruby-1.8.2
./configure
make
make test
sudo make install

________________________________________________________________

Get Ruby gems

curl -O http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz
tar xvzf rubygems*
cd rubygems*
sudo ruby setup.rb

________________________________________________________________

Get Rails and a few other gems

sudo gem install rails RedCloth search_generator salted_login_generator production_log_analyzer
answer yes to all dependencies

________________________________________________________________

Get mysql-ruby C bindings (the pure ruby ones suck) This command works great on osx as well using the mysql 4.1.x installer from mysql.com or the serverlogistics.com mysql as well.

curl -O http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz
tar zxvf mysql-ruby-*
cd mysql-ruby-*
ruby extconf.rb --with-mysql-config
make
sudo make install

________________________________________________________________

download fastcgi developers kit

curl -O http://fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar xvzf fcgi-2.4.0.tar.gz
cd fcgi*
./configure
make
sudo make install

________________________________________________________________

Get the new non memory leaking ruby-fastcgi bindings

curl -O http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz
tar xzvf ruby-fcgi*
ruby install.rb config
ruby install.rb setup
sudo ruby install.rb install

________________________________________________________________

We need the correct pcre .so’s for lighttpd to work correctly

curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-5.0.tar.gz
tar xzvf pcre-5.0.tar.gz
cd pcre-*
./configure
make
sudo make install

________________________________________________________________

Get lighttpd

curl -O http://www.lighttpd.net/download/lighttpd-1.4.6.tar.gz
tar xzvf lighttpd-1.3.13.tar.gz
cd lighttpd-*
./configure
make
sudo make install

________________________________________________________________

Compile php as a fast-cgi binary The main thing here is the following configure options. You can add whatever else you like to your php binary but these are needed for fast-cgi support.

$ ./configure \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \

________________________________________________________________

Lighttpd Launcher Script

Here is a link for a sweet enhancement. Put this script in your RAILS_ROOT/script folder and put the lighttpd.conf file in RAILS_ROOT/config. Now you can launch your rails app by cd’ing into your RAILS_ROOT for your app and typing: $ruby script/lighty -p 7500 -e development (or whatever port & env you want to use) Now you can hit http://localhost:7500/ and you will get your app running on lighttpd no muss no fuss. Very sweet for development. Here is the link: Lighttpd Launcher Scripts . Name the first ruby script lighty and name the config file lighttpd.conf. Now every time you start your app this way is creates a new lighttpd.conf in /tmp and starts lighttpd up with that file. This way you can give it command line options as to what port to bind to and others. I’m using this for development and it is sweet!