I am going to echo posts scattered throughout the Internet here and say
I cannot get Ruby gems working due to lack of zlib. Trying to install a
package like Rails gives the error:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__':\
no such file to load -- zlib (LoadError)
I am sure you guys have had this question many times before but your
search engine is broken ("Application Error (Rails)") so I can't check
the archive.
I am on Ubunutu Warty and have tried installing every package under the
sun via apt, anything with zlib or ziplib in the name. I can't install
ruby via apt because rails wants 1.8.4, not packaged.
This is what worked for me.
Remove all the ruby packages using synaptic: ALL of them
You need to install zlibc, zlib1g, zlib1g-dev, then recompile ruby.
e.g. sudo apt-get install zlibc etc.
THen install ruby-1.8.4 from source
Then download rubygems and install it.
Thanks, I'll give this a shot. I did install all three of those (zlibc,
zlib1g, zlib1g-dev) previously and recompiled ruby184 after to no avail.
However, I'm not sure that I removed ALL ruby packages first, so I will
try that.
This is what worked for me.
Remove all the ruby packages using synaptic: ALL of them
You need to install zlibc, zlib1g, zlib1g-dev, then recompile ruby.
e.g. sudo apt-get install zlibc etc.
THen install ruby-1.8.4 from source
Then download rubygems and install it.
No dice. Here's the relevant section from make, which appears to be
unable to find zlib:
compiling zlib
make[1]: Entering directory `/root/ruby-1.8.4/ext/zlib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/ruby-1.8.4/ext/zlib'
making ruby
If configure didn't find zlib the first time it won't check if you just run 'make'.
···
On Jan 26, 2006, at 4:48 PM, Ryan Tate wrote:
Thanks, I'll give this a shot. I did install all three of those (zlibc,
zlib1g, zlib1g-dev) previously and recompiled ruby184 after to no avail.
However, I'm not sure that I removed ALL ruby packages first, so I will
try that.
--
Eric Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant
WTF? I go to compile my own zlib, so I am trying to remove zlib1g, when
I get:
The following packages will be REMOVED:
base-config console-common console-data console-tools cramfsprogs
emacs21
file gnupg initrd-tools initscripts libgnutls10 libldap2 libmagic1
libneon24
libopencdk8 libpng12-0 libtiff4 libxml2 libzzip-0-10 libzzip-dev
lvm-common
lvm10 lvm2 lynx modutils openssh-client openssh-server python
python2.3
reportbug sysvinit udev util-linux w3m zlib1g zlib1g-dev
WARNING: The following essential packages will be removed
This should NOT be done unless you know exactly what you are doing!
sysvinit initscripts (due to sysvinit) util-linux zlib1g (due to
util-linux)
Obviously I aborted. I am now wondering whether it is even advisable to
make my own build of zlib. Hmm.
Basically after make and make test and make install still didn't produce
a working gems (same zlib error), I cd-ed into /[ruby source
dir]/ext/zlib and poked around. There was a Makefile, but make didn't
work on it. Noticed extconf.rb. Executed it in ruby. Tried make again.
Bingo. Tried make install. Bingo. Tried installing gems. Booyah!
It seems the main thing that happened is that the ruby zlib make file
put zlib.so in /usr/local/lib/ruby/site_ruby/1.8/i686-linux.
IMHO this means something is likely borked on the ruby 184 source
install. Shouldn't it have done all this for me? Or noted it in the
docs?
Anywhere, here's the sordid transcripts, with some inconsequential cd-s
and cat-s omitted. By the way, I did this on top of my prior source
install, after it had run.
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.
Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem
root@li9-121 ~/rubygems-0.8.11 [623] gem install rails
--include-dependencies
Attempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
Updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-1.0.0
Successfully installed rake-0.7.0
... etc etc etc (dependencies probably)
Ryan, you saved my bacon. I was running into EXACTLY the same problem
tonight. Thought I had my rails all up and running and nothing worked.
Went to the RoR site and it helpfully says that 1.8.2 and 1.8.4 of ruby
work, but not 1.8.3. Guess what version my new Ubuntu has...
Then when I went to source, I saw the exact same problem. Thankfully, I
appear to have run into it about 24 hours after you.
Anyway, thanks mate - that worked beautifully. Now - someone should be
logging a bug for the ruby folks, no?
Thanks a lot Ryan Tate
That actually fixed it.
3 evenings trying to fix the Angel-forsaken thing.
A big Mr Hat from South Park to U.
U rule
Ryan Tate wrote:
···
YES! Done. Done. Done!
Basically after make and make test and make install still didn't produce
a working gems (same zlib error), I cd-ed into /[ruby source
dir]/ext/zlib and poked around. There was a Makefile, but make didn't
work on it. Noticed extconf.rb. Executed it in ruby. Tried make again.
Bingo. Tried make install. Bingo. Tried installing gems. Booyah!
It seems the main thing that happened is that the ruby zlib make file
put zlib.so in /usr/local/lib/ruby/site_ruby/1.8/i686-linux.
# ruby extconf.rb
checking for deflateReset() in -lz... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib... no
What a brick wall. =/
- Rabbit
~/tmp/browser_dowloads/ruby-1.8.5-p2/ext/zlib$ ruby extconf.rb
checking for deflateReset() in -lz... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib... no
checking for deflateReset() in -lzdll... no
*** extconf.rb failed ***
This is painful. Have yet to discover the right incantations.
Help anyone? Many thanks.
Install zlib (and, if your OS is that weird, its headers too).
···
On Dec 3, 2006, at 21:42 , David Drub wrote:
Daniel Waite wrote:
I'm having the same problem, but when I run:
ruby extconf.rb
I get:
# ruby extconf.rb
checking for deflateReset() in -lz... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib... no
What a brick wall. =/
- Rabbit
~/tmp/browser_dowloads/ruby-1.8.5-p2/ext/zlib$ ruby extconf.rb
checking for deflateReset() in -lz... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib... no
checking for deflateReset() in -lzdll... no
*** extconf.rb failed ***
This is painful. Have yet to discover the right incantations.
Help anyone? Many thanks.