开发者

Installing libxml-ruby gem fails because zlib is missing

开发者 https://www.devze.com 2023-02-18 04:39 出处:网络
When trying to install the ruby gem libxml-ruby on my windows computer I get the following error message

When trying to install the ruby gem libxml-ruby on my windows computer I get the following error message

D:/.../bin/ruby.exe extconf.rb
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... yes
checking for inflate() in -lz... no
checking for inflate() in -lzlib... no
checking for inflate() in -lzlib1... no
 extconf failure: need zlib
开发者_StackOverflow社区

Can someone tell me how to install this gem? I googled for answers and also found the zlib libraries but don't know where to use them.

I am using ruby version 1.8.7 with devkit 4.5.1

MY SOLUTION

  1. Copied the zlib1.dll from the ruby/bin folder to the ruby/lib folder
  2. downloaded the iconv.dll from ftp://ftp.zlatkovic.com/libxml/ and put it also in the ruby/lib folder
  3. downloaded the libxml2 from ftp://ftp.zlatkovic.com/libxml/ and put the libxml-folder from the include folder in the devkit include directory for mingw (in my case sth. like devkit/mingw/mingw32/include)


I found development headers for windows98/NT/2000/XP/2003 on this page linked from zlib.net

You need that if you want to use zlib in your programs. Officially, zlib does not have a "programmers manual", but a quick read to zlib.h will make your ideas clearer.


Check that you have the zlib headers installed. On many linux distros this is a package named "zlib-devel".

Edit: I just realized you are using a Windows environment. I don't have any development experience with Windows, but your going to need the zlib.h somewhere on your include path. My guess is that you only have the .dll file, which would allow already compiled programs to use zlib but wouldn't allow you to compile any source code that references it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号