Project

General

Profile

Actions

Bug #1157

closed

missing zlib.rb?

Added by sinobra (Fred Obermann) over 15 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
Backport:
[ruby-core:22058]

Description

=begin
I just installed 1.9.1 onto Mandriva 2009 (Linux version 2.6.27.10-desktop-1mnb () (gcc version 4.3.2 (GCC) ))
Ran ./configure
Ran make
Ran: gem install rails

And this is what I got:

[root@tango ruby-1.9.1-p0]# gem install rails
/usr/local/lib/ruby/1.9.1/rubygems/package.rb:10:in require': no such file to load -- zlib (LoadError) from /usr/local/lib/ruby/1.9.1/rubygems/package.rb:10:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/format.rb:9:in require' from /usr/local/lib/ruby/1.9.1/rubygems/format.rb:9:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:11:in require' from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:11:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/dependency_installer.rb:3:in require' from /usr/local/lib/ruby/1.9.1/rubygems/dependency_installer.rb:3:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/commands/install_command.rb:4:in require' from /usr/local/lib/ruby/1.9.1/rubygems/commands/install_command.rb:4:in <top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/command_manager.rb:140:in require' from /usr/local/lib/ruby/1.9.1/rubygems/command_manager.rb:140:in rescue in load_and_instantiate'
from /usr/local/lib/ruby/1.9.1/rubygems/command_manager.rb:132:in load_and_instantiate' from /usr/local/lib/ruby/1.9.1/rubygems/command_manager.rb:65:in []'
from /usr/local/lib/ruby/1.9.1/rubygems/command_manager.rb:118:in find_command' from /usr/local/lib/ruby/1.9.1/rubygems/command_manager.rb:104:in process_args'
from /usr/local/lib/ruby/1.9.1/rubygems/command_manager.rb:75:in run' from /usr/local/lib/ruby/1.9.1/rubygems/gem_runner.rb:39:in run'
from /usr/local/bin/gem:24:in `'
=end

Actions #1

Updated by sinobra (Fred Obermann) over 15 years ago

=begin
By the way, zlib is installed on the machine, details as follows:
Version: 1.2.3-12mdv2009.0
Currently installed version: 1.2.3-12mdv2009.0
=end

Actions #2

Updated by sinobra (Fred Obermann) over 15 years ago

=begin
In the build directory, these files and directories exist:

./ext/zlib
./ext/zlib/doc/zlib.rd
./ext/zlib/zlib.c
./test/zlib
./test/zlib/test_zlib.rb
./.ext/rdoc/Zlib/zlib_version-c.yaml

but I don't see a zib.rb
=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

=begin
Hi,

At Sat, 14 Feb 2009 15:44:44 +0900,
Fred Obermann wrote in [ruby-core:22059]:

By the way, zlib is installed on the machine, details as follows:
Version: 1.2.3-12mdv2009.0
Currently installed version: 1.2.3-12mdv2009.0

You need the package for development too.

--
Nobu Nakada

=end

Actions #4

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions #5

Updated by mwlang (Michael Lang) over 15 years ago

=begin
I encountered the same error when installing to a fresh copy of Ubuntu 8.10 Intrepid Ibex. Turned out ext/zlib has extconf.rb which means its make files get generated from calling "ruby extconf.rb"

Since there was no ruby interpreter installed, the extconf.rb files couldn't be executed. Solution:

./configure
make
sudo make install

repeat

./configure
make
sudo make install
=end

Actions #6

Updated by lmueller (Lutz Mueller) over 15 years ago

=begin
my apologies if this is obvious, but I struggled with the same problem.

gem update fails in a similar manner.

I downloaded the zlib sources from www.zlib.net, went through configure/make/make install.
I then went back to the ruby 1.9.1 source directory and also repeated the configure/make/make install.
Afterwards, I was able to do a "gem update" and a "gem install rails".

I am posting this here because this happened to be the first place I hit in search for a solution.
FWIW, Michael Lang's solution (above) did not work for me.

I am running Ubuntu 8.10 Intrepid.

Regards, Lutz
=end

Actions #7

Updated by Radar (Ryan Bigg) almost 15 years ago

=begin
I too have encountered this issue with a completely bare-bones installation of Ruby 1.9.1-p243.

To fix it, I followed Lutz steps about downloading and compiling zlib and then I cd'd into the /ext/zlib directory, ran ruby extconf.rb && make && sudo make install then "sudo gem install rails" worked. I feel that going through the whole Ruby ./configure && make && sudo make install process is excessive.
=end

Updated by weigui (wei gui) over 13 years ago

The error is due to zlib1g-dev is not installed by default. In ubuntu, to solve it:

  1. sudo apt-get install zlib1g-dev # to install the dependent zlib
  2. cd /ext/zlib # go to ext/zlib in ruby source directory
  3. ruby extconf.rb
  4. make # to generate zlib.so
  5. make install
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0