[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to make installing Ruby easier for amateurs

Tom Cloyd

12/22/2008 6:16:00 AM

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@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@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


18 Answers

Saji N. Hameed

12/22/2008 7:13:00 AM

0

Hi Tom,

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

saji

* Tom Cloyd <tomcloyd@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@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@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@apcc21.net
KOREA



Bill Kelly

12/22/2008 7:26:00 AM

0


From: "Tom Cloyd" <tomcloyd@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



M. Edward (Ed) Borasky

12/22/2008 7:55:00 AM

0

Bill Kelly wrote:
>
> From: "Tom Cloyd" <tomcloyd@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.

James Britt

12/22/2008 8:06:00 AM

0

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/bootstr...

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

Marc Heiler

12/22/2008 10:06:00 AM

0

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

I do not think it ever will. How many years have gone by now since the
first user had the problem with this concerning ruby on debian at least?
3 years?

Debian Users will continue to have split-up packages, and as a result
continue to have all these problems which reoccur every some months on
the list here, or on a forum somewhere else. This is a fundamental flaw
in philosophy concerning packaging on Linux boxes altogether in fact.

The only thing I do not quite understand is why debian developers do not
tell the users loudly that these problems are because of debian, and not
because of the ruby python etc... guys.
--
Posted via http://www.ruby-....

Ezra Zygmuntowicz

12/22/2008 5:07:00 PM

0


On Dec 22, 2008, at 12:05 AM, James Britt wrote:

> 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/bootstr...


If you use this script you should change line 27 to add the --disable-
pthreads flag

/configure --disable-pthreads

This can cause a 20-100% speed up on the interpreter as long as you
don't need to use tk.

Cheers-

Ezra Zygmuntowicz
ez@engineyard.com




Chad Woolley

12/22/2008 8:42:00 PM

0

On Mon, Dec 22, 2008 at 10:06 AM, Ezra Zygmuntowicz <ezmobius@gmail.com> wrote:
> If you use this script you should change line 27 to add the
> --disable-pthreads flag
>
> ./configure --disable-pthreads
>
> This can cause a 20-100% speed up on the interpreter as long as you
> don't need to use tk.

Thanks Ezra, committed:

http://github.com/thewoolleyman/cinabox/commit/a584281d510b03ff91261531f17a22...

I had incorrectly assumed this was the default...

-- Chad

Aníbal Rojas

12/23/2008 12:58:00 PM

0

Tom,

Yes, it is frustating, to make it a little bit simple install the
package: ruby-full which should give you everything that is ruby
related. But you will still need to install build-essential to be able
to compile native dependencies if you require them.

And yes, the differences between the Ruby community and the Debian
packagers always arise, and there are good points at both side about
how to do the things.

--
Aníbal Rojas
http://hasmanydeve...
http://ruby...
http://anibal.ro...

On Dec 23, 1:15 am, Tom Cloyd <tomcl...@comcast.net> 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.
>
> 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@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
> << t...@tomcloyd.com >> (email)
> << TomCloyd.com >> (website)
> << sleightmind.wordpress.com >> (mental health weblog)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Jörg W Mittag

12/23/2008 10:04:00 PM

0

Marc Heiler wrote:
>> Forget apt-get for Ruby. Maybe one day that will work as most people
>> expect it should. But today is not that day.
> I do not think it ever will. How many years have gone by now since the
> first user had the problem with this concerning ruby on debian at least?
> 3 years?
>
> Debian Users will continue to have split-up packages, and as a result
> continue to have all these problems which reoccur every some months on
> the list here, or on a forum somewhere else. This is a fundamental flaw
> in philosophy concerning packaging on Linux boxes altogether in fact.

Can you explain how this is a fundamental flaw in Linux packaging?
TeX, Emacs, Perl, PHP, Python, Java, they all share most if not all of
Ruby's challenges: all have their own directory layouts, their own
search paths, their own library paths, their own versioning schemes,
their own package managers, their own distribution formats, multiple
different implementations, multiple different versions. Most have
native C extensions. Most were not created with Linux package managers
in mind -- heck, most were created before Linux package managers even
existed.

And yet, all of them work perfectly fine. All except Ruby.

This reminds me of the guy on the freeway listening to the traffic
channel and thinking to himself: "What are they talking about, a car
driving the wrong way on the freeway? It's not *a* car, it's hundreds
of them!"

jwm

Tom Cloyd

12/24/2008 2:47:00 AM

0

Jörg W Mittag wrote:
> Marc Heiler wrote:
>
>>> Forget apt-get for Ruby. Maybe one day that will work as most people
>>> expect it should. But today is not that day.
>>>
>> I do not think it ever will. How many years have gone by now since the
>> first user had the problem with this concerning ruby on debian at least?
>> 3 years?
>>
>> Debian Users will continue to have split-up packages, and as a result
>> continue to have all these problems which reoccur every some months on
>> the list here, or on a forum somewhere else. This is a fundamental flaw
>> in philosophy concerning packaging on Linux boxes altogether in fact.
>>
>
> Can you explain how this is a fundamental flaw in Linux packaging?
> TeX, Emacs, Perl, PHP, Python, Java, they all share most if not all of
> Ruby's challenges: all have their own directory layouts, their own
> search paths, their own library paths, their own versioning schemes,
> their own package managers, their own distribution formats, multiple
> different implementations, multiple different versions. Most have
> native C extensions. Most were not created with Linux package managers
> in mind -- heck, most were created before Linux package managers even
> existed.
>
> And yet, all of them work perfectly fine. All except Ruby.
>
> This reminds me of the guy on the freeway listening to the traffic
> channel and thinking to himself: "What are they talking about, a car
> driving the wrong way on the freeway? It's not *a* car, it's hundreds
> of them!"
>
> jwm
>
>
>
Interesting comment. I have to say that I don't see it as a flaw in
Linux packaging either. I began this thread by objecting to "secret
knowledge" - the knowledge that Rubygems, once you install it, cannot
function with something else which it never names and which I've never
heard of. There's always secret knowledge, of course, BUT, dammit, if
program X cannot do its thing without dependency Z, then I expect X to
take care of itself. I don't expect to have to do it myself. As an
ignorant amateur, that asking too much of me.

I see LOTS of things in Ruby taking care of themselves. But...when I go
to install Ruby, it comes WITHOUT RubyGems. Does that actually make
sense to anyone at all? If RubyGems is optional, why is it more optional
than all those exotic libraries that automatically come with Ruby. I'm
FAR more likely to need RubyGems, as a learner, than some library that
parses HTML header files or whatever (just making this UP!), or messes
with obscure aspects of networks. Priorities seem misplaced here.

The other side of it is this: if Ruby isn't going to come alive with
Rubygems (and, of course, all that IT needs to function), then it looks
like Rubygems needs to look out for itself. Otherwise, *I* have to it,
and I haven't a clue (well, I sure do now, of course - but why did I
have to run off the cliff 6 times to get this sorted out?). I protest
about this because I deeply love and respect Ruby. I want to push others
to try it. I don't want them to have some of these crazy problems I've
had. It doesn't seem necessary.

So, I'm back where I started. This particular problem just needs to be
fixed. I can't do it - I don't know enough. I'm in favor of making
things work. How about you?

t.

--

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