From: Tom Cloyd on
Greetings!

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
such case:

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)
from extconf.rb:1


Gem files will remain installed in /var/lib/gems/1.8/gems/RedCloth-4.1.1
for inspection.
Results logged to
/var/lib/gems/1.8/gems/RedCloth-4.1.1/ext/redcloth_scan/gem_make.out
ubuntu(a)ubuntu:~$

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.)

t.

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc(a)tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


From: Saji N. Hameed on
Hi Tom,

It is likely an (K|X)Ubuntu issue than a ruby-gem issue.

saji

* Tom Cloyd <tomcloyd(a)comcast.net> [2008-12-22 15:15:31 +0900]:

> Greetings!
>
> 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
> such case:
>
> 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)
> from extconf.rb:1
>
>
> Gem files will remain installed in /var/lib/gems/1.8/gems/RedCloth-4.1.1
> for inspection.
> Results logged to
> /var/lib/gems/1.8/gems/RedCloth-4.1.1/ext/redcloth_scan/gem_make.out
> ubuntu(a)ubuntu:~$
>
> 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.)
>
> t.
>
> --
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
> Bellingham, Washington, U.S.A: (360) 920-1226
> << tc(a)tomcloyd.com >> (email)
> << TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental
> health weblog)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>

--
Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 saji(a)apcc21.net
KOREA



From: Bill Kelly on

From: "Tom Cloyd" <tomcloyd(a)comcast.net>
>
[...]
> extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
> from extconf.rb:1
>
[...]
>
> The solution? Install the ruby1.8-dev library or package or whatever the
> heck it is. It's in the Adept package manager.

This appears to be partly a manifestation of the eternal clash
between ruby vs. the Debian packaging philosophy.

It is the Debian package maintainers who carve up the Ruby
standard library into fragmented packages.

This is described as beneficial for persons attempting to
install software on systems with extremely minimal storage
resources.

On the other hand, year after year it results in confusion for
individuals who had done "apt-get install ruby" with the
expectation that this would result in a complete ruby
installation.

So there are trade-offs...

However in this case it does also sound like there may simply
be a missing dependency for rubygems on the ruby*-dev package.

If so, we should alert the Debian ruby package maintainers.


Regards,

Bill



From: M. Edward (Ed) Borasky on
Bill Kelly wrote:
>
> From: "Tom Cloyd" <tomcloyd(a)comcast.net>
>>
> [...]
>> extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
>> from extconf.rb:1
>>
> [...]
>>
>> The solution? Install the ruby1.8-dev library or package or whatever
>> the heck it is. It's in the Adept package manager.
>
> This appears to be partly a manifestation of the eternal clash
> between ruby vs. the Debian packaging philosophy.
>
> It is the Debian package maintainers who carve up the Ruby
> standard library into fragmented packages.
>
> This is described as beneficial for persons attempting to install
> software on systems with extremely minimal storage
> resources.
>
> On the other hand, year after year it results in confusion for
> individuals who had done "apt-get install ruby" with the
> expectation that this would result in a complete ruby installation.
>
> So there are trade-offs...
>
> However in this case it does also sound like there may simply
> be a missing dependency for rubygems on the ruby*-dev package.
>
> If so, we should alert the Debian ruby package maintainers.
>
>
> Regards,
>
> Bill
>
>
>
>

You also need "make", "gcc" and sometimes other libraries / header files
to build some gems from source. Even if the whole Ruby shootin' match is
installed, you may still get errors like this. Some of the distros, for
example Gentoo, have built many of the Ruby dependencies into their own
packaging system. So, for example, on Gentoo, you can say "emerge
rubygems" and it will install Ruby if that isn't there. And you can say,
"emerge rails" and it will bring in rake, rubygems, activerecord, etc.

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P), WOM

I've never met a happy clam. In fact, most of them were pretty steamed.

From: James Britt on
Tom Cloyd wrote:
> Greetings!
>
> 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
> such case:
>
> 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.


http://github.com/thewoolleyman/cinabox/tree/master/bootstrap_ruby.sh

Forget apt-get for Ruby. Maybe one day that will work as most people
expect it should. But today is not that day.


Big thanks to Chad Woolley for that script.


--
James Britt

www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff