Thursday, December 4, 2008

Ruby + Rails + Hpricot on a Mac OS X

How to install Ruby + Rails + Hpricot on a Mac OS X from source on
Mac OS X Leopard (10.5)

If you want to use MySQL go to this page and install it per these
instructions.

Go to this site and follow the directions in this post to install Ruby and rails.

Check your Ruby configuration:
ruby -rrbconfig -e "p Config::CONFIG"

Install Hpricot
sudo gem install hpricot

Try out irb (ruby command shell)

Check that the correct ruby environment is being used
$ gem env gemdir
/usr/local/lib/ruby/gems/1.8

Check that the correct ruby executable is being used
derek-pappas-computer:~ dpappas$ which ruby
/usr/local/bin/ruby
$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.5.0]

Check the installed gems
gem list

Check that the hpricot bundle is in the Mac OS X gems dir
find `gem env gemdir`/gems/hpricot-* -name \*.bundle -ls

Install hrpicot into the lib the easy way
sudo gem install hpricot

Check that hpricot gem is in the load path
ruby -rubygems -e 'require "hpricot"'

No comments:

Post a Comment