I'm on Windows, with Ruby 2.0 installed using RailsInstaller.
When I tried to install id3lib-ruby using gem install id3lib-ruby, I get the following:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing id3lib-ruby:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
checking for main() in -lstdc++... yes
checking for main() in -lz... no You must have zlib installed.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.
Check the mkmf.log file for more details.
You may need configuration options.
In mkmf.log, it includes the line:
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lz
collect2: ld returned 1 exit status
I have zlib1.dll in C:\RailsInstaller\Ruby2.0.0\bin, renaming the file to zlib.dll doesn't work. So, it looks like RubyInstaller already included the zlib library, but something's still causing the gem install to fail. Any ideas?
Couldn't work it out. "Fixed" by installing RailsInstaller 2.2.2 (Ruby 1.9.3) and taglib-ruby instead.
Related
So basically RubyNumberTheory require the NArray gem, and it seems it requires some native compilation tools and probably some additional configuration. So on a Fedora 29, here is what was tried
$ gem install narray
Building native extensions. This could take a while...
ERROR: Error installing narray:
ERROR: Failed to build gem native extension.
[…]
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
I did installed a few packages, through dnf like gcc ruby-devel rubygems and group install "C Development Tools and Libraries"and even some more unexpected arm-none-eabi-newlib. Actually, the header seems well installed on the system
$ whereis stdint.h
stdint: /usr/include/stdint.h
Even with environment variable set as following:
export LIBRARY_PATH=/usr/include
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/include
The gem still won't install, telling stdint.h wasn't found. What else could be attempted?
Looking in the mkmf.log file, it appeared the system was lacking redhat-hardened-cc1, so a simple sudo dnf install redhat-rpm-config fixed that.
I found this "Zlib missing" continously when installing gems for Rails on Ruby, please let me know a solution :
Fetching nokogiri 1.10.2
Installing nokogiri 1.10.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.2/ext/nokogiri
/usr/local/opt/ruby/bin/ruby -I /usr/local/Cellar/ruby/2.6.2/lib/ruby/2.6.0 -r ./siteconf20190407-34092-u44l37.rb extconf.rb
checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for iconv.h... yes
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
I also re-installed OSX 10.14 SDK header but didn't work.
It turned out that I have to manually download zlib from its site and then install it myself to make it work.
Extract the package then install as instruction :
./Configure
make
make install
I uninstall version 0.18.1 and now I cannot install any of the versions.
I would like to install 0.18.2
I am running this command:
gem install pg -v '0.18.2'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/liviu-mac/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150901-1693-1wdi2b8.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.
Don't know how to fix the installation?
I used a wrong path, the correct command in my case is:
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
I used 9.3 instead of 9.4
It looks like a frequent error, but after 2 days, I still did not find the definite solution to this issue.
I installed Ruby 2.0.0-p451 (x64) and DevKit (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe) from RubyInstaller for Windows. Ruby -v returns:
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]
Now, I run gem install tiny_tds, which returns:
E:\>gem install tiny_tds
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
E:/Ruby200/bin/ruby.exe extconf.rb
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv is missing.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Actually, the only libiconv I have on my system is E:\Ruby200\bin\libiconv-2.dll
I tried all I could find around without success, but I'm sure there is a smart answer to this. Can you please help me find it ?
Thanks a lot,
Best regards,
Fred
Here is the cropped error when I tried the command 'gem install mechanize'
Building native extensions. This could take a while...
C:/Ruby/bin/ruby.exe extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokog
iri.html for help with installing dependencies.
-----
extconf.rb failed
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
then I tried to install the libxml using 'gem install libxml' and it returns following error
ERROR: Possible alternatives: eimxml, eim_xml, irxml, libacl, libowl
It will be better if there is any EXE or precompiled installer that can install the mechanize with all the dependencies.
I am using Windows7(64 bit) and, ruby 2.0.0p247 (2013-06-27) [x64-mingw32]