简体   繁体   中英

Gem::InstallError: nokogiri requires Ruby version < 2.4, >= 2.1.0. rails

After running rails new demo I get the following error:

Gem::InstallError: nokogiri requires Ruby version < 2.4, >= 2.1.0.
An error occurred while installing nokogiri (1.7.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.1'` succeeds before bundling.

My Ruby version is 1.9.3. I could update ruby but I'm worried that may create even more problems. Any suggestions?

More Information:

The Nokogiri gem is not listed in my Gemfile, if I run gem list it includes nokogiri (1.6.8.1 x86-mingw32, 1.6.6.2 x86-mingw32, 1.6.1 x86-mingw32)

You need to downgrade the version of nokogiri to ~> 1.6.8

change nokogiri version in Gemfile

gem 'nokogiri', '~> 1.6.8'

Dependency for nokogiri version 1.6.8 is ruby >= 1.9.2 https://rubygems.org/gems/nokogiri/versions/1.6.8

But it is changed for nokogiri version 1.7.1 to ruby >= 2.1.0 https://rubygems.org/gems/nokogiri/versions/1.7.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM