Unable to install thin

On a newly installed Lenny server with Ruby1.8.7 and Rubygems installed
from source (not package) and latest rails installed through rubygems

$ sudo gem1.8 install thin
Building native extensions. This could take a while...
ERROR: Error installing thin:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
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/eventmachine-0.12.8 for inspection.
Results logged to

What dependency did I miss?

Damn Debian!

$ sudo aptitude install ruby1.8-dev


$ sudo gem1.8 install rack thin