Zlib.so (LoadError)


#1

I’m getting the error below when trying to install ruby gems on Windows
Vista.
My Ruby version is 1.8.7 and gems 1.3.1. I installed Ruby from the zip
file ruby-1.8.7-i386-mswin32.zip and gems by running ruby setup.rb.

The zlib.so file is in the directory so I don’t know why it can’t find
it. Help appreciated.

programs/ruby/lib/ruby/1.8/i386-mswin32/zlib.so: 126: The specified
module could not be found. -
c:/programs/ruby/lib/ruby/1.8/i386-mswin32/zlib.so (LoadError)
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/package.rb:10 from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/format.rb:9 from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:11 from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:3 from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:4 from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:140:inload_and_instantiate’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:65:in
[]' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:118:infind_command’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in
process_args' from c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:75:inrun’
from
c:/programs/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in
`run’
from c:/programs/ruby/bin/gem:24


#2

Are you compiling from source? I’ve never tried to get Ruby running
under Vista besides the One-Click Installer, but on Linux, the zlib
errors usually come up when I don’t have the development libraries
installed.


#3

Hello,

You need the zlib.dll.

  1. http://www.zlib.net/ and download compiled DLL, version 1.2.3
  2. Copy downloaded zlib1.dll into
    C:\ruby-1.8.7-i386-mswin32\bin\zlib.dll
    Notice that the name changes from zlib1.dll to zlib.dll
  • Alex

#4

Tks Alex.

I just copied the zlib1.dll to zlib.dll and it seems this works too.

Michael

Alex 2k8 wrote:

Hello,

You need the zlib.dll.

  1. http://www.zlib.net/ and download compiled DLL, version 1.2.3
  2. Copy downloaded zlib1.dll into
    C:\ruby-1.8.7-i386-mswin32\bin\zlib.dll
    Notice that the name changes from zlib1.dll to zlib.dll
  • Alex