Forum: Ruby Problem installing gem

Posted by Alex Gian (alexg)
on 2006-07-05 08:40
Hi, first post here, hope it's the right forum.

I recently tried to install RoR on two systems, both RedHat9, very 
similar configurations, although the one is a server (hence remote 
installation) the other a  desktop.

On the desktop, the installation was fine, and I got to my test screen 
on port 3000 without problems.

On the server, the system has got stuck on the gem installation, and I 
would like it to get unstuck!  ;)

Here is what ruby setut.rb gives:

=======================================================
>>> [...snip]
install timer.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install user_interaction.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install validator.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install version.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
<--- lib/rubygems
<--- lib

As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a 
while)...
...done.
No library stubs found.

>>> [...normally, at this point it would say OK on a good installation...]

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
`gem_original_require': no such file to load -- zlib (LoadError)
        from 
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:9
        from 
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/builder.rb:7
        from 
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:93:in 
`manage_gems'
        from 
/noncrit/downloads/ruby/rubygems-0.9.0/./post-install.rb:70:in 
`install_sources'
        from 
/noncrit/downloads/ruby/rubygems-0.9.0/./post-install.rb:81:in 
`try_run_hook'
        from setup.rb:577:in `run_hook'
        from setup.rb:1315:in `exec_task_traverse'
        from setup.rb:1168:in `exec_install'
        from setup.rb:887:in `exec_install'
        from setup.rb:705:in `invoke'
        from setup.rb:674:in `invoke'
        from setup.rb:1352

=======================================================

Can anyone give any pointers?
BTW, I also tried getting rubygem-0.9.0, but it gave exactly the same 
problem.

Seems to me it's not finding some file it needs, but I don't understand 
enough to see which one it is (or even IF that's the prob)

Thanks people...
Posted by Rida Al Barazi (Guest)
on 2006-07-05 10:31
(Received via mailing list)
On 7/5/06, Alex Gian <alexgian@blueyonder.co.uk> wrote:
> On the server, the system has got stuck on the gem installation, and I
> <--- lib/rubygems
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
>         from setup.rb:1315:in `exec_task_traverse'
> problem.
>
> Seems to me it's not finding some file it needs, but I don't understand
> enough to see which one it is (or even IF that's the prob)
>
> Thanks people...
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
Not sure about this but it seems that either it's not able to find your
zlib, or it is not even installed, try to install zlib ruby bindings
(libzlib-ruby), and the zlib library <http://www.zlib.net/> itself.
Posted by Alex Gian (alexg)
on 2006-07-05 11:21
Rida Al Barazi wrote:
> Not sure about this but it seems that either it's not able to find your
> zlib, or it is not even installed, try to install zlib ruby bindings
> (libzlib-ruby), and the zlib library <http://www.zlib.net/> itself.

Thanks Rida,

That's one of the first things that came to mind, so I specifically 
checked that both "zlib" and "zlib-dev"(or whatever it's called) are 
installed.  Makes no difference.

What's more intriguing is that the practically identical desktop RH9 
installation (yes, the machine I won't be using ;( ) has installed it 
just fine.  Which is good cause I can have a little play-around.  But I 
really do need to have it on the server...  Ho-hum...


(I am not sure about the libzlib-ruby, but I didn't need that on the 
other -desktop- installation)
Posted by Alex Gian (alexg)
on 2006-07-07 21:02
=BUMP=

No ideas?
It's quite frustrating, the system is running fine on the workstation 
atm, but I really need it on the server.

They're both RH9, everything I could think ofhas been checked.
I've tried re-installing... same problem.

Can anyone at least point me to the lines in the rubygems installer that 
I should be checking?

Thanks again.
Posted by Austin Ziegler (austin)
on 2006-07-07 21:40
(Received via mailing list)
On 7/7/06, Alex Gian <alexgian@blueyonder.co.uk> wrote:
> =BUMP=

This is not a forum where this is acceptable behaviour to do that.
(Frankly, it's unacceptable behaviour even on web fora, but the
standards for netiquette have always been lower on web fora than
anywhere else.) The so-called "Ruby Forum" is a mailing list gateway.
You just sent a "bump" message to thousands of people and added more
mail to people who don't have time to deal with it. Don't do that
again.

To your problem. How did you install Ruby? If you installed from
source and didn't have zlib and zlib-dev installed when you originally
built, then you probably need to recompile. If you installed from a
package, you might be missing something like ruby-zlib. This is more
common to be missing that on systems where they break Ruby into a
zillion little pieces (Debian), but who knows? RedHat 9 could have a
Stupid Ruby Package Setup, too.

Probably does, given what a POS RH9 is.

-austin
Posted by Caleb Tennis (Guest)
on 2006-07-07 21:43
(Received via mailing list)
> That's one of the first things that came to mind, so I specifically
> checked that both "zlib" and "zlib-dev"(or whatever it's called) are
> installed.  Makes no difference.

Have you tried uninstalling and reinstalling ruby and its related 
packages
after making sure zlib and zlib-dev are installed?
Posted by Alex Gian (alexg)
on 2006-07-08 18:26
Austin Ziegler wrote:
>> =BUMP=
> 
> This is not a forum where this is acceptable behaviour to do that.
Sorry, didn't realise it was a mailer, too - I use it as a web forum. 
Wouldn't have done it if I knew.  I felt an honest "bump" was more 
polite than some contrived reason to post.

> To your problem. How did you install Ruby? If you installed from
> source and didn't have zlib and zlib-dev installed when you originally
> built, then you probably need to recompile.
I installed from source.
Subsequently, I de-installed everything, got the zlibs and zlib-devs 
into place and re-compiled.  Several times.  Tried rubygems-0.9.0, too. 
Still nothing (or, rather, still the first error msg)

The irritating thing is that it runs just fine on an almost identical 
RH9 setup (which I'm using ATM to get up to speed :) ).

> Probably does, given what a POS RH9 is.
Can't say I share your experience, since my server has been a rock for 
me for over 5yrs!  This is the _first_ weird installation prob. I've 
ever had.  I'm just sorry it's so long in the tooth now, I'd like to 
keep it going as long as possible. (Ubuntu next, p'haps?)

===

Further with the problem:
The offending line in the err message points to the file:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb at line 27
this looks like:
26>  def require(path)
27>    gem_original_require path
28>  rescue LoadError => load_error

I can't say I really see what it's driving at, though I assume the 
message is the "rescued" load error. Anyone konw what this "path" is 
supposed to be, and where it should be set?





Posted by Alex Gian (alexg)
on 2006-08-05 02:46
Well, I finally solved it.

After a month of limping along on an auxilliary server, of installing 
every version of zlib known to man, and of a lot of swearing, I finally 
figued it out!

The problem was that the installation HARDCODED the RELATIVE address of 
zlib in relation to the source code during "configure".  I had moved the 
source directory, considering it to be temporary.

Wow.  A hardcoded relative address.  Relative to source code. Is that 
good practise?

Once I figured it, a reconfigure and rebuild from the new source 
location sorted everything...  Just mentioning it, cuase it might catch 
someone else out, too.  Anyway, I'm happy now, everything is working as 
it should.  Phew!
Posted by Rene Medina (rmedina)
on 2006-09-27 07:29
Alex Gian wrote:
> Well, I finally solved it.
> 
> After a month of limping along on an auxilliary server, of installing 
> every version of zlib known to man, and of a lot of swearing, I finally 
> figued it out!
> 
> The problem was that the installation HARDCODED the RELATIVE address of 
> zlib in relation to the source code during "configure".  I had moved the 
> source directory, considering it to be temporary.

Would you explain what one have to do to do a correct installation, step 
by step, please?

> 
> Wow.  A hardcoded relative address.  Relative to source code. Is that 
> good practise?
> 
> Once I figured it, a reconfigure and rebuild from the new source 
> location sorted everything...  Just mentioning it, cuase it might catch 
> someone else out, too.  Anyway, I'm happy now, everything is working as 
> it should.  Phew!
Posted by Nick Poulden (truckle)
on 2006-12-30 14:25
Hi all,

I also had this problem, and fixed it by installing ruby-zlib manually. 
The source files is available from 
http://raa.ruby-lang.org/project/ruby-zlib. Simply extract the files, 
run ruby extconf.rb, make, make install. Running ruby setup.rb in the 
gem source directory then worked fine.

Nick
Posted by Eric Hodel (Guest)
on 2006-12-31 01:53
(Received via mailing list)
On Dec 30, 2006, at 05:25, Nick Poulden wrote:
> I also had this problem, and fixed it by installing ruby-zlib  
> manually.
> The source files is available from
> http://raa.ruby-lang.org/project/ruby-zlib. Simply extract the files,
> run ruby extconf.rb, make, make install. Running ruby setup.rb in the
> gem source directory then worked fine.

No.

zlib is part of ruby since 1.8.

If your ruby doesn't have the zlib libraries file a bug with your
ruby packager.

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!
Posted by Lukas Rieder (overbryd)
on 2008-04-02 18:15
Hello,

I was struggling with the same problem for about two days.
The final solution was installing ruby-zlib and then reinstalling 
rubygems from source. Dunno why...

This is quite strange, because my ruby version is 1.8.6, gem version 
1.1.0, zlib and zlib-devel were installed before the installation of 
ruby & rubygems.

But after I've installed ruby and rubygems from source I was haunted by 
this error when I tried to install rails. (gem i rails 
--include-dependencies)

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- zlib (LoadError)

This solved my zlib LoadError issue:

wget http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
tar xvzf ruby-zlib-0.6.0.tar.gz
cd ruby-zlib-0.6.0
ruby extconf.rb && make && make install

(and reinstall your rubygems from source)

Have a nice day,


Lukas Rieder
Posted by Iphan Iphan (iphan)
on 2008-05-22 00:19
Lukas Rieder wrote:
> Hello,
> 
> I was struggling with the same problem for about two days.
> The final solution was installing ruby-zlib and then reinstalling 
> rubygems from source. Dunno why...

Just installed ruby 1.8.6 on CentOS 5 in my local directory. It installs 
a broken gem by default, which crashes on execution:

/myhome/bin/gem:8:in `require': no such file to load -- rubygems 
(LoadError)
        from /myhome/bin/gem:8

Reinstalling rubygems 1.1.1 from source as indicated above fixed it.

Thanks Lukas for the tip, much appreciated!


Isabelle
Posted by Kingdon Barrett (yebyen)
on 2008-09-03 20:36
For reference, that is obsolete as somebody else mentioned.

On Debian, you can build and install RubyGems as long as you have got 
zlib1g-dev before you start your build of Ruby.

Long-dead thread, but it was unresolved...
kingdon@tuesdaystudios.com

Lukas Rieder wrote:
> This solved my zlib LoadError issue:
> 
> wget http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
> tar xvzf ruby-zlib-0.6.0.tar.gz
> cd ruby-zlib-0.6.0
> ruby extconf.rb && make && make install
> 
> (and reinstall your rubygems from source)
> 
> Have a nice day,
> 
> 
> Lukas Rieder
Posted by Travis Bell (travisbell)
on 2009-03-28 00:20
Lukas Rieder wrote:

> This solved my zlib LoadError issue:
> 
> wget http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
> tar xvzf ruby-zlib-0.6.0.tar.gz
> cd ruby-zlib-0.6.0
> ruby extconf.rb && make && make install
> 
> (and reinstall your rubygems from source)

That fixed the issue for me as well. Completely stock CentOS 5 install 
(with zlib & zlib-devel)... installed Ruby from source, installed 
Rubygems and boom, zlib load error.

Manually installed ruby-zlib, re-installed Rubygems and away we go.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.