Posts Tagged ‘tutorials’

Install Mongrel & Hpricot Under Ubuntu

Monday, March 24th, 2008

When­ever I do a fresh install of Ubuntu, and I’m set­ting up Ruby, Rails, I always run into the same prob­lem with a hand­ful of gems (such as Mon­grel & Hpri­cot). This is how things usu­ally go down:

matt@thinkpad:~$ sudo gem install hpricot
Building native extensions.  This could take a while...
ERROR:  Error installing hpricot:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install hpricot
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1
Gem files will remain installed in
/usr/lib/ruby/gems/1.8/gems/hpricot-0.6 for inspection.
Results logged to
/usr/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/gem_make.out

Now what? The main prob­lem here is that Hpri­cot and Mon­grel both con­tain some C code that needs to be com­piled. In order to fix this, you’ll need to install the Ruby & C devel­op­ment libraries for Ubuntu. To do that, just fire up Ter­mi­nal and enter:

sudo apt-get install ruby1.8-dev linux-libc-dev libc6-dev

You should now be able to install Hpri­cot, Mon­grel, or any other gem that requires you to build some C. It’s that easy!

What I’m Reading: 3/19

Wednesday, March 19th, 2008
  1. Mar­t­ian Head­sets: Spolsky’s take on IE8 & web standards.
  2. Trans­la­tion From MS-Speak to Eng­lish of Selected Por­tions of Joel Spolsky’s “Mar­t­ian Head­sets”: Mark Pilgrim’s take on the above.
  3. Site­Point Guru Lists: SitePoint’s authors have listed the best arti­cles on the Site­Point, er, site, for get­ting started in var­i­ous areas of web design & development.