If you’re a Debian or Ubuntu user you’ll find that the Ruby standard
distribution is split into lots of little packages so doing something like
apt-get install ruby
only gives you the ruby binary and a subset of the libraries for Ruby. You’ll
need to add more packages if you want to utilize more of Ruby’s standard
library. This is all in order to comply with
That is all well and good but a little frustrating when you ‘just want to
do work’.
For example, I wanted to install
(Something I really believe should be in Ruby’s standard distribution)
however ran into the following:
$ sudo gem install sys-proctable
Building native extensions. This could take a while…
extconf.rb:8:in `require’: no such file to load — mkmf (LoadError)
from extconf.rb:8
ERROR: While executing gem … (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sys-proctable-0.7.3 for inspection.
To get around this you will need to install ruby1.8-dev (or ruby1.6-dev or
whatever version of ruby you’re running) to get mkmf.rb which is listed
in the Ruby Standard Library.
I’m sure most Ruby hackers worth their salt consider this a ‘duh’ thing
but not of all of us can be shining stars in the Ruby community
How I fixed it…
$ sudo apt-get install ruby1.8-dev
..
$ sudo gem install sys-proctable
{ 3 } Comments
Thank you!! I am running Gentoo and slowly moving to Ubuntu and this was killing me. Solved the first problem trying to get ruby-ncurses to work on Ubuntu. I already have this working on Gentoo and OSX. Thanks
Thanks! this got me past an issue that was driving me nuts….
Thanks! This was the trick I needed in order to successfully get the Oracle Rails library installed.
{ 5 } Trackbacks
[…] search led me to one Al Hoang, who discovered that upgrading to ruby1.8-dev would resolve this — apparently mkmf.rb is not […]
[…] But of course if I had it… I would be having an issue. I searched more and found this blog post that talked about mkmf and Ubuntu. It said to install ruby1.8-dev. Simple enough. Install the […]
[…] Su p*** madre. Al menos esto fue googlear medio minuto, y al parecer es problema con mi versión de Kubuntu. Un sencillo sudo apt-get install ruby1.8-dev y solucionado. Cortesía de Al Hoang […]
[…] I got the solution thanks to this guy […]
[…] How to fix your gem / mkmf error in !ruby http://blogs.law.harvard.edu/hoanga/2006/10/27/fixing-mkmf-load-error-ruby-in-ubuntu/ […]