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]
Related
I was trying to install gem sqlite3 but failed with error below.
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/usr/local/opt/ruby/bin/ruby -r ./siteconf20151016-8328-1i1buur.rb extconf.rb --with-sqlite3-dir /usr/bin
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.
.....
I just searched through and solved it via installing XCode before installing sqlite3, can anyone tell me the reason? What does XCode actually do?
I am a newbie on those gem of Ruby.
Installing XCode (or more precisely the XCode command line tools) will also install the toolchain needed to compile the native extensions (written in C) needed by the sqlite3 gem.
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
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.
I'm getting the following error after running bundle install with Selenium-webdriver ~>2.35.1 in my Gemfile (which has a dependency on Nokogiri).
Building native extensions with: '--with-xml2-lib=/usr/lib64 --with-xml2-include=/usr/include/libxml2 --with-xslt-lib=/usr/lib64 --with-xslt-include=/usr/include/libxslt'
This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/local/mxp25/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb --with-xml2-lib=/usr/lib64 --with-xml2-include=/usr/include/libxml2 --with-xslt-lib=/usr/lib64 --with-xslt-include=/usr/include/libxslt
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-redhat-linux/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-redhat-linux/ports/libxml2/2.8.0/configure.log' to see what happened.
*** 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've tried specifying both native libraries that Nokogiri needs with the command line, but that doesn't seem to help.
I also cannot locate the "mkmf.log" file or the "configure.log" file.
I tried and was able to get Nokogiri 1.5.10 installed.
sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... no
*** 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 have sqlite3-ruby installed as well as the header files, but for some reason it fails when checking for sqlite3_open()
I am having the same issue:
sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.1.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.1.1/ext/do_sqlite3/gem_make.out
I am running Snow Leopard. I'm not sure about previous installations of sqlite3 but I did try this:
port search sqlite
And it returned the following (among others):
...
sqlite3 #3.6.17 (databases)
an embedded SQL database engine
To be honest I'm not sure what all this means. What would anyone suggest for getting do_sqlite3 installed for use in Rails 3 with DataMapper? (Also, running it without the 'env ARCHFLAGS="-arch x86_64"' gives the same errors.)
Ok, first question is why are you passing the ARCHFLAGS? That should not be necessary, if it also doesn't work without passing them, what is the output you get then?
Next question is what version of sqlite3 is it picking up? Do you have sqlite3 installed through Macports for example? Did you upgrade to Snow Leopard recently and still have an sqlite3 install from before upgrading?