Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having trouble installing Nokogiri on Windows 7 32 bit, OS #1632

Closed
jaishanker123 opened this issue Apr 24, 2017 · 5 comments
Closed

Having trouble installing Nokogiri on Windows 7 32 bit, OS #1632

jaishanker123 opened this issue Apr 24, 2017 · 5 comments

Comments

@jaishanker123
Copy link

If you're having trouble installing

Dear, I am facing installation issue on Windows 7, 32 bit OS.

Please help and find output error below.

D:\branch_new\gems>gem install nokogiri-1.6.8.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing nokogiri-1.6.8.gem:
ERROR: Failed to build gem native extension.

D:/ruby/ruby/bin/ruby.exe extconf.rb

Using pkg-config version 1.1.9
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0


IMPORTANT NOTICE:

Building Nokogiri with a packaged version of zlib-1.2.8.

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

gem install nokogiri -- --use-system-libraries
    [--with-xml2-config=/path/to/xml2-config]
    [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

Downloading zlib-1.2.8.tar.gz (100%)
*** 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=D:/ruby/ruby/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:259:in verify_file': Downloaded file 'D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.8/ports/archives/zlib-1.2.8 .tar.gz' has wrong hash: expected: 44d667c142d7cda120332623eab69f40 is: 231f7ee33bfdc938b664efd0e1625e06 (RuntimeError) from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:51:in block in download'
from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:49:in each' from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:49:in download'
from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:146:in cook' from extconf.rb:364:in block (2 levels) in process_recipe'
from extconf.rb:257:in block in chdir_for_build' from extconf.rb:256:in chdir'
from extconf.rb:256:in chdir_for_build' from extconf.rb:363:in block in process_recipe'
from extconf.rb:262:in tap' from extconf.rb:262:in process_recipe'
from extconf.rb:482:in `

'

Gem files will remain installed in D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.8 for inspection.
Results logged to D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.8/ext/nokogiri/gem_make.out

D:\branch_new\gems>

@flavorjones
Copy link
Member

Nokogiri 1.6.8 is an older release which references zlib 1.2.8. zlib 1.2.8 is no longer available for download from the zlib team as a supported release.

One option is to upgrade to nokogiri v1.7.1 which uses zlib 1.2.11. this version of zlib 1.2.11 is support and downloadable.

Another option is to use the precompiled version of nokogiri for the windows platform, rather than compiling everything with devkit. You should be able to do this by running:

gem install nokogiri

or, if that's trying to compile things, try

gem install nokogiri --platform mingw32

More details can be found in the installation tutorial: http://www.nokogiri.org/tutorials/installing_nokogiri.html

Good luck!

@jaishanker123
Copy link
Author

Dear Sir,

nokogiri v1.7.1 needs ruby version 2.1.0 and I can't my ruby version because of some reason.

Is there any other way for using nokogiri v1.6.8 gem .

Please find error.

D:\LX_release7_branch_new\gems>gem install nokogiri-1.7.0.1.gem
ERROR: Error installing nokogiri-1.7.0.1.gem:
nokogiri requires Ruby version >= 2.1.0.

D:\LX_release7_branch_new\gems>ruby -v
ruby 2.0.0p451 (2014-02-24) [i386-mingw32]

D:\LX_release7_branch_new\gems>gem install nokogiri --platform mingw32
ERROR: Error installing nokogiri:
nokogiri requires Ruby version >= 2.1.0._

@flavorjones
Copy link
Member

In the final command you run, you need to specify the version of the gem that you want to install. Try

gem install nokogiri --platform mingw32 -v 1.6.8

@jaishanker123
Copy link
Author

Dear Mike,

I am still getting below error for command "gem install nokogiri --platform mingw32 -v 1.6.8".

D:\branch\gems>gem install nokogiri --platform mingw32 -v 1.6.8
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.

D:/ruby/ruby/bin/ruby.exe extconf.rb

Using pkg-config version 1.1.7
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0


IMPORTANT NOTICE:

Building Nokogiri with a packaged version of zlib-1.2.8.

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

gem install nokogiri -- --use-system-libraries
    [--with-xml2-config=/path/to/xml2-config]
    [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

404 Not Found
*** 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=D:/ruby/ruby/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
D:/ruby/ruby/lib/ruby/2.0.0/digest.rb:44:in initialize': No such file or directory - D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.8/ports/archives/zlib-1.2.8.tar.gz (Errno::ENOENT) from D:/ruby/ruby/lib/ruby/2.0.0/digest.rb:44:in open'
from D:/ruby/ruby/lib/ruby/2.0.0/digest.rb:44:in file' from D:/ruby/ruby/lib/ruby/2.0.0/digest.rb:29:in file'
from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:257:in verify_file' from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:51:in block in download'
from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:49:in each' from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:49:in download'
from D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:146:in cook' from extconf.rb:364:in block (2 levels) in process_recipe'
from extconf.rb:257:in block in chdir_for_build' from extconf.rb:256:in chdir'
from extconf.rb:256:in chdir_for_build' from extconf.rb:363:in block in process_recipe'
from extconf.rb:262:in tap' from extconf.rb:262:in process_recipe'
from extconf.rb:482:in `

'

Gem files will remain installed in D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.8 for inspection.
Results logged to D:/ruby/ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.8/ext/nokogiri/gem_make.out

@flavorjones
Copy link
Member

@jaishanker123 this will be addressed in nokogiri 1.8.0. in the meantime please consider upgrading to 1.7.1 or 1.7.2. Or else, don't use ruby devkit and use the precompiled binary gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants