Gem problem installing Rails / Ubuntu Gutsy

Please take a look at the following. I try to make it clear what my
problems are…

http://pastie.caboo.se/132571

-------- Original-Nachricht --------

Datum: Fri, 28 Dec 2007 08:28:59 +0900
Von: Jesse C. [email protected]
An: [email protected]
Betreff: Gem problem installing Rails / Ubuntu Gutsy

Please take a look at the following. I try to make it clear what my
problems are…

Parked at Loopia

Posted via http://www.ruby-forum.com/.

Hi,

you don’t have zlib installed. (http://www.zlib.net/)

Best regards,

Axel

Axel E. wrote:

-------- Original-Nachricht --------

Please take a look at the following. I try to make it clear what my
problems are…

Parked at Loopia

Hi,

you don’t have zlib installed. (http://www.zlib.net/)

Best regards,

Axel

Hello, and thank you. I installed zlib using ./configure; make test;
make install, tho I still get the same errors… (?)

for whereis zlib : zlib:
for whatis zlib : nothing appropriate

Thanks,
Jess

On Fri, Dec 28, 2007 at 08:55:18AM +0900, Jesse C. wrote:

Hi,
for whereis zlib : zlib:
for whatis zlib : nothing appropriate

Thanks,
Jess

Hi…

ehm why you use the package managment (apt?) to install gem etc. and
compiling zlib from source? apt-get install zlib1g-dev does it fine.

P.S. I use my ruby environment basically from Ubuntu and all the gem
stuff from the ruby community. So I don’t have trouble with the
package management for upgrades in the future.

Greetings
Mario

Mario G. wrote:

On Fri, Dec 28, 2007 at 08:55:18AM +0900, Jesse C. wrote:

ehm why you use the package managment (apt?) to install gem etc. and
compiling zlib from source? apt-get install zlib1g-dev does it fine.

P.S. I use my ruby environment basically from Ubuntu and all the gem
stuff from the ruby community. So I don’t have trouble with the
package management for upgrades in the future.

Greetings
Mario

same problems after apt installing zlib1g-dev

results: Parked at Loopia

further, I installed Ruby and Gems from source (I believe), tho I am a
newb; so, can you please explain your post script to me?

Thanks,
Jess

On Fri, Dec 28, 2007 at 10:27:55AM +0900, Jesse C. wrote:

same problems after apt installing zlib1g-dev

results: Parked at Loopia

further, I installed Ruby and Gems from source (I believe) …

If you didn’t have the -dev zlib package installed when you compiled
Ruby from source, the Ruby zlib extension can’t have been built.

Its a little confusing because two subtly different things share the
same name - a plain old C shared library, and a ruby extension that
uses it. It’s the latter part that is being complained about in those
error messages.

Try rebuilding now that you have the -dev package installed, and see
if that helps.

Note that you’ll probably find that other extensions bundled with the
interpreter are missing if you don’t have the requisite -dev packages
when you build.

Stephen L. wrote:

Jesse C. wrote:

same problems after apt installing zlib1g-dev

results: Parked at Loopia

further, I installed Ruby and Gems from source (I believe) …

If you didn’t have the -dev zlib package installed when you compiled
Ruby from source, the Ruby zlib extension can’t have been built.

Its a little confusing because two subtly different things share the
same name - a plain old C shared library, and a ruby extension that
uses it. It’s the latter part that is being complained about in those
error messages.

Try rebuilding now that you have the -dev package installed, and see
if that helps.

Note that you’ll probably find that other extensions bundled with the
interpreter are missing if you don’t have the requisite -dev packages
when you build.

Whoa. I am confused. Thanks so much for helping, but nothing seems to
work. I had a similar problem with MySQL, and it turned out all I had
to do was reboot.

this is all i can think to do: whereis zlib
zlib: /usr/include/zlib.h /usr/share/man/man3/zlib.3.gz

Say I want to start from scratch. Can this be done without a fresh OS
install?

It really shouldn’t be a problem to start over.

Find all the ruby packages installed with
$> dpkg -l | grep -i ruby

Then remove each of them
$> sudo apt-get remove --purge ruby rdoc rubygems rails (etc…)

Then reinstall.

These days I’m really not sure what to recommend to people in terms of
how
to install ruby and gems on ubuntu.

Usually I run my production machines with Ruby and Gems from apt and
Rails
from Gems. Which would require something like…
$> sudo apt-get install ruby rdoc ri ruby-extras ruby-gems
$> sudo gem install rails

Doing it from source (especially if it’s a development machine) is
really
easy also. The trick in Ubuntu is to use apt to install all the
dependencies before building the source package. So you’d do something
like…
$> sudo apt-get build-dep ruby rdoc ri ruby-extras ruby-gems

Then download and install the source packages.

The same trick works with the database gems. If your going to install
the
mysql, postgres or sqlite gem install their coresponding apt package
dependencies first, then the gem
$> sudo apt-get build-dep libmysql-ruby1.8 libsqlite3-ruby1.8
libpgsql-ruby1.8
$> gem install mysql sqlite postgres

I just made a blog post about running all three side by side that may
help
also.

http://blog.michaelgreenly.com/2007/12/multiple-ruby-version-on-ubuntu.html

Michael G. wrote:

. . . .

I just made a blog post about running all three side by side that may
help
also.

http://blog.michaelgreenly.com/2007/12/multiple-ruby-version-on-ubuntu.html

Thanks so much. In the meantime I had solved it for my purposes.

  1. sudo apt-get install --reinstall zlib1g zlib1g-dev
  2. in ~/ruby-1.8.6/ __ sudo ./configure; sudo make; sudo make install
  3. in ~/rubygems-1.0.1/ __ sudo ruby setup.rb

ruby -v returns 1.8.6
gem -v returns 1.0.1

sudo gem update --system __ works
sudo gem install rails __ works

Yay !