Can't Install Nokogiri for Ruby in Windows

Can't install Nokogiri for Ruby in Windows

Update: As of version 1.6.2, Nokogiri now does support the 64-bit version of Ruby 2.0.0. (Note that it requires libxml >= 2.6.21 )

Here's the answer if you still need to install the x86 version for some reason or if you want to understand how to install and build a gem using DevKit:


Nokogiri does not yet support the 64-bit version of Ruby 2.0.0. You can read about it and follow the status here.

But Nokogiri does support the x86 version of ruby 2.0.0. You should be able to install the gem in on 2.0.0 x86 install.

It's pretty easy to hand-install. I prefer that over RailsInstaller because I need to maintain other things as they are. Here's how:

  1. Download and unzip the files for the version you need. Be sure to download the correct version of DevKit for the x86 version of 2.0.0.

  2. Fix your path: Make sure your path includes the directories to the right ruby, gem, and DevKit dirs:
    Assume you installed the x86 version of ruby 2.0.0 into C:\rubies\ruby-2-0-0-x86 and the associated DevKit into C:\rubies\DevKit-xxxx-x86 you will need to include these directories in your PATH:

    C:\rubies\ruby-2-0-0-x86\bin
    C:\rubies\ruby-2-0-0-x86\lib\ruby\gems\2.0.0
    C:\rubies\DevKit-xxxx-x86\bin

  3. Inject DevKit into the right ruby install: Once you have ruby installed and can get the correct info when you type ruby -v, then run ruby dk.rb init -- which will get DevKit set up & 'injected' into the correct ruby version. (N.B. I always have to edit the config.yml file that is produced and put in the correct path to the ruby installation I want. Don't sweat it if you need to do that.)

Error installing Nokogiri via Bundler on Windows

This particular version of Nokogiri is listed in Gemfile.lock. You can remove that file, run bundle install again and see if it works.

This is more a workaround than a proper solution, but dependencies in Gemfile.lock are quite old so it would be a good thing to refresh them anyway.

Unable to gem install nokogiri

I think the answer was staring us in the face, your version of nokogiri requires Ruby less than 2.3, and you're running ruby 2.3.

It seems you're not the only one with this issue: https://github.com/sparklemotion/nokogiri/issues/1456

How to install Nokogiri Gem for Windows

You need DevKit to compile the gem properly.

Can't install Nokogiri 1.4.3 gem

I managed to get 1.4.7 to install by doing (close to) the following:

git clone git@github.com:sparklemotion/nokogiri.git
cd nokogiri
gem install rake-compiler hoe racc rexical
git checkout v1.4.7 # 1.4.3 in your case
# edit ./ext/nokogiri/extconf.rb and replace `Config` with `RbConfig`
rake install_deps
rake install_gem

Hopefully I didn't forget a step.

Edit: Scratch that, the installed gem doesn't work. I'm going to leave this here for now in case it helps someone.

Edit (Jonas): Hint for the solution is in a bug report. I stick with Ruby 2.1.5 and it solved this issue.

Nokogiri error install

Delete your path folder(if it shows) and your Gemfile.lock .
Then place this in your gem file

 gem 'nokogiri', '~> 1.6', '>= 1.6.8.1'

After that run bundle install .Remove the nokogiri from your gemfile



Related Topics



Leave a reply



Submit