As an amateur, and intermittent, programmer, I often run right off the
edge of what I know. Sometimes this seems utterly needless. Here’s one
In the past year I’ve switched from WindowsXP to Kubuntu Linux. I’ve had
to reload the operating system maybe four times, plus two more due to
acquiring a USB hard drive (now my primary drive), and now setting my up
Kubuntu to run from a flash drive. I have to reinstall Ruby each time,
of course. And…EACH TIME I RUN INTO THE SAME STUPID PROBLEM, as
exemplified by my experience yesterday:
I install Ruby 1.8 (yesterday, it was 1.8.7, of course) using either
apt-get or the Adept package manager. Then I install Rubygems with
apt-get (it’s not in Adept’s sources, apparently).
Ready to GO? You would think so. Naively, I always do. But it’s not to
be. Now the madness starts, and this is what I want fixed.
It turns out that Rubygems has a hidden dependency (I think I’m using
the right term, but if not, correct me). It isn’t automatically
installed, and without it, gem installation simply crashes and burns,
without useful comment. For an amateur such as me, this isn’t helpful,
to put it mildly. Here’s what happens:
~$ sudo gem install RedCloth
Building native extensions. This could take a while…
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install RedCloth
extconf.rb:1:in `require’: no such file to load – mkmf (LoadError)
Gem files will remain installed in /var/lib/gems/1.8/gems/RedCloth-4.1.1
Results logged to
The solution? Install the ruby1.8-dev library or package or whatever the
heck it is. It’s in the Adept package manager.
I’m sure many on this list know all about this, but it’s not reasonable
to expect amateurs like to know such things, and there no sign on the
side of the road advertising the fact. It’s simply “secret knowledge”. I
hate secret knowledge.
I’ve been “had” by this problem at least 6 times. It always happens
about 5 weeks past the time I’ve forgotten about it. I DO have a full
life aside from my Ruby adventures.
So…if Rubygems needs this library or whatever, why cannot it check to
see that it’s present, and then complain if it’s not? The error msg it
does report means nothing to me at all. Personally, I think the Ruby
package from Adept should include this, but that’s another story.
Basic idea: don’t leave tiger traps lying about when you know that
children will be coming down the path.
Is this possible? Am I asking too much?
(Update: the only reason by I ran into this problem at all was that I
was reluctant to do on the flash drive OS what I do now regularly:
compile and install from source. This is the best idea of all, of
course, as documented recently by the fellow who issues the “Zen of
Ruby” blog newsletter, since it produces an executable which is about
twice as fast as that distributed by the package managers.)
Tom C., MS MA, LMHC - Private practice Psychotherapist Bellingham, Washington, U.S.A: (360) 920-1226 << [email protected] >> (email) << TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental health weblog)