Forum: Ruby Error with gems 1.2.0 on ubuntu hardy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bruno M. (Guest)
on 2008-10-10 08:50
First I apologize my poor English.

After to install  the ruby 1.8.7 patch level 22 on ubuntu 8.04 hardy
succefully.Then I tryed to install rubygems 1.2 in sequence and I
received this error message:

xyz@xyz: /usr/local/src/rubygems-1.2.0$ sudo ruby setup.rb
/lib/rubygems/spec_fetcher.rb:1:in `require': no such file to load --
zlib (LoadError)

How Can I fix this problem? Everyone had this experience?

Thank's so much for help me!


Bruno
Brian C. (Guest)
on 2008-10-10 12:10
Bruno M. wrote:
> After to install  the ruby 1.8.7 patch level 22 on ubuntu 8.04 hardy
> succefully.Then I tryed to install rubygems 1.2 in sequence and I
> received this error message:
>
> xyz@xyz: /usr/local/src/rubygems-1.2.0$ sudo ruby setup.rb
> /lib/rubygems/spec_fetcher.rb:1:in `require': no such file to load --
> zlib (LoadError)
>
> How Can I fix this problem? Everyone had this experience?

You need to compile and install ruby again from source, but this time
with the zlib development package installed (I think it's called
"zlib1g-dev" or something like that; I don't have an Ubuntu machine
handy right now)

This is so that Ruby can build its own zlib extension.
Bruno M. (Guest)
on 2008-10-10 20:32
Thank's but After zlib1g libs installation the problem has not solved

And I didn't unistall ruby

I tried many kind of commands like for uninstall and re-compile ruby:

sudo apt-get remove ruby libruby libruby1.8 ruby1.8 irb rdoc ri
sudo aptitude remove ruby
sudo dpkg --list | grep ruby, dpkg -r
and through Synaptic too

and when I invoke ruby or irb, this commands works normally...
Brian C. (Guest)
on 2008-10-10 20:50
Bruno M. wrote:
> Thank's but After zlib1g libs installation the problem has not solved

zlib1g-dev

> And I didn't unistall ruby

I imagine you compiled ruby 1.8.7 from source, as it's not a standard
Hardy package. If not, how did you install it? Was it from some
non-standard repository? If so, perhaps their package is broken.
Bruno M. (Guest)
on 2008-10-10 22:09
Thanks again Brian

I compiled ruby from source in the first time.

sudo apt-get install gcc g++ build-essential
cd /usr/src
sudo wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p22.tar.bz2
sudo tar -jxvf ruby-1.8.7-p22.tar.bz2
cd /ruby-1.8.7-p22
sudo ./configure
sudo make
sudo make install

ruby -v

ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux])   ...it's ok

cd /usr/src
sudo wget http://rubyforge.org/frs/download.php/38646/rubyge...
sudo tar -zxvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
sudo ruby setup.rb

Doesn't work...


After I install using

sudo apt-get install ruby rdoc ri irb libyaml-ruby libzlib-ruby ri
ruby1.8-dev

or

sudo apt-get remove ruby rdoc ri irb libyaml-ruby libzlib-ruby ri
ruby1.8-dev

sudo apt-get install ruby rubygems irb ri rdoc ruby1.8-dev
build-essential

or

sudo apt-get autoremove ruby ruby rubygems irb ri rdoc ruby1.8-dev

sudo apt-get install -y ruby1.8 ri1.8 rdoc1.8 rake irb1.8




Brian C. wrote:
> Bruno M. wrote:
>> Thank's but After zlib1g libs installation the problem has not solved
>
> zlib1g-dev
>
>> And I didn't unistall ruby
>
> I imagine you compiled ruby 1.8.7 from source, as it's not a standard
> Hardy package. If not, how did you install it? Was it from some
> non-standard repository? If so, perhaps their package is broken.
Brian C. (Guest)
on 2008-10-10 23:13
Bruno M. wrote:
> sudo ./configure
> sudo make
> sudo make install
>
> ruby -v
>
> ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux])   ...it's ok

Now look in ext/zlib/mkmf.log - that will probably tell you why the zlib
extension isn't being built. Post it here if it doesn't make sense.

Do you definitely have the zlib1g-dev package installed?

Hmm, perhaps you also need libssl-dev installed. Try that.
Bruno M. (Guest)
on 2008-10-11 00:02
Brian, I  followed this tutorial and gotcha!

works!


http://blog.fiveruns.com/2008/3/3/compiling-ruby-r...

Thanks so much Brian

Some day I hope to contribute too witch this community !

Thanks so much!

Bruno M. wrote:
> Thanks again Brian
>
> I compiled ruby from source in the first time.
>
> sudo apt-get install gcc g++ build-essential
> cd /usr/src
> sudo wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p22.tar.bz2
> sudo tar -jxvf ruby-1.8.7-p22.tar.bz2
> cd /ruby-1.8.7-p22
> sudo ./configure
> sudo make
> sudo make install
>
> ruby -v
>
> ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux])   ...it's ok
>
> cd /usr/src
> sudo wget http://rubyforge.org/frs/download.php/38646/rubyge...
> sudo tar -zxvf rubygems-1.2.0.tgz
> cd rubygems-1.2.0
> sudo ruby setup.rb
>
> Doesn't work...
>
>
> After I install using
>
> sudo apt-get install ruby rdoc ri irb libyaml-ruby libzlib-ruby ri
> ruby1.8-dev
>
> or
>
> sudo apt-get remove ruby rdoc ri irb libyaml-ruby libzlib-ruby ri
> ruby1.8-dev
>
> sudo apt-get install ruby rubygems irb ri rdoc ruby1.8-dev
> build-essential
>
> or
>
> sudo apt-get autoremove ruby ruby rubygems irb ri rdoc ruby1.8-dev
>
> sudo apt-get install -y ruby1.8 ri1.8 rdoc1.8 rake irb1.8
>
>
>
>
> Brian C. wrote:
>> Bruno M. wrote:
>>> Thank's but After zlib1g libs installation the problem has not solved
>>
>> zlib1g-dev
>>
>>> And I didn't unistall ruby
>>
>> I imagine you compiled ruby 1.8.7 from source, as it's not a standard
>> Hardy package. If not, how did you install it? Was it from some
>> non-standard repository? If so, perhaps their package is broken.
This topic is locked and can not be replied to.