Nokogiri: Fail install on Ruby 2.3 for Windows

Created on 5 Apr 2016  路  17Comments  路  Source: sparklemotion/nokogiri

gem install rails
on nokogiri install fail with error: 'nokogiri requires Ruby version < 2.3, >= 1.9.2.'

gem install nokogiri -v '1.6.5'
solve problem of installation
but
gem update
again fails

Most helpful comment

A quick workaround is the following (ruby 2.3 win64):

gem install nokogiri -v '1.6.6.4'
gem install rails 
gem install nokogiri -v '1.6.8.rc3'

After that explictly include
gem 'nokogiri', '>=1.6.8.rc3'
in gemfile

gem update works without error
bundle install and bundle update works too

All 17 comments

Not sure but it seems that nokogiri and 2.3 is not fully supported yet by Rails on Windows.
Any way, I tried to install the latest version on Windows 64-bits and ruby 2.3:

gem install nokogiri -v 1.6.8.rc3 -N

and it was installed successfully:

Fetching: pkg-config-1.1.7.gem (100%)
Successfully installed pkg-config-1.1.7
Fetching: mini_portile2-2.1.0.gem (100%)
Successfully installed mini_portile2-2.1.0
Fetching: nokogiri-1.6.8.rc3-x64-mingw32.gem (100%)
Nokogiri is built with the packaged libraries: libxml2-2.9.3, libxslt-1.1.28, zlib-1.2.8, libiconv-1.14.
Successfully installed nokogiri-1.6.8.rc3-x64-mingw32
3 gems installed

But when trying to install rails it failed:

gem install rails -N
ERROR:  Error installing rails:
        nokogiri requires Ruby version < 2.3, >= 1.9.2.

@Javix

Not sure but it seems that 2.3 is not supported yet on Windows.

Already supported... after long time wait
http://rubyinstaller.org/downloads/

@Sega100500 I meant

that nokogiri and 2.3 is not fully supported

i.e. Nokogiri with Ruby 2.3. You can even try to install rspec-rails on Ruby 2.3 to see the same error of nokogiri Ruby version.

@Javix
Ruby 2.3 + nokogiri
On Linux it work, on windows - no

Ruby-2.3 cross build targeting Windows RubyInstaller was added in this commit . Please try the latest pre-release:

gem inst nokogiri --pre

or per Gemfile:

gem 'nokogiri', '1.6.8.rc3'

The installation from source should work as well (with nokogiri-1.6.7):

gem inst nokogiri --platform ruby

@larskanis Thanks very much :+1: Perfect timing.

@larskanis
Fine. But how about gem update?
Install nokogiri of specific version - is not problem. Problem is when nokogiri update it fail installation.

A quick workaround is the following (ruby 2.3 win64):

gem install nokogiri -v '1.6.6.4'
gem install rails 
gem install nokogiri -v '1.6.8.rc3'

After that explictly include
gem 'nokogiri', '>=1.6.8.rc3'
in gemfile

gem update works without error
bundle install and bundle update works too

@okeyparking
It work! Many thanks!

As mentioned above, windows is supported in the prerelease and will be in 1.6.8 final.

@okeyparking

I'm totally new to this, could you tell me how to:

After that explictly include
gem 'nokogiri', '>=1.6.8.rc3'
in gemfile

Same question as Zbromination, Plz explain

After that explictly include
gem 'nokogiri', '>=1.6.8.rc3'
in gemfile

@okeyparking, @zuckerlinh: Hey, guys, just add gem 'nokogiri', '>=1.6.8.rc3 in your Rails application Gemfile (outside of the development, test, production group) and run bundle update nokogiri.

Yes. It works. Thanks. :)

Thanks @larskanis & @Javix :)

@Javix @okeyparking @zuckerlinh I'm also totally new to this, and I have to ask how do you open my Rails application Gemfile and add gem 'nokogiri', '>=1.6.8.rc3 in? That's the only thing holding me off right now

@BurstNova it would be better not to polute the issue tracker with such kind of questions, try Stackoverflow please.
You can open Gemfile as no matter which file in your file system with your preferred text editor.

Was this page helpful?
0 / 5 - 0 ratings