Nokogiri requires Ruby version < 2.3

2019-02-14 05:17发布

I am trying to get Rails to work on Windows 10. I am using Ruby 2.3.0, and Rails 4.2.6, and am temporarily using Nokogiri 1.6.3.

When I try running rails new demo, it returns an error:

An error occurred while installing nokogiri (1.6.7.2), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.7.2'` succeeds before bundling.

When I run gem install nokogiri -v '1.6.7.2 I get:

ERROR:  Error installing nokogiri:
        nokogiri requires Ruby version < 2.3, >= 1.9.2.

How do I update Nokogiri and get Rails to work?

5条回答
孤傲高冷的网名
2楼-- · 2019-02-14 05:37

use bundle update nokogiri, but also check you ruby version ruby -v

查看更多
Juvenile、少年°
3楼-- · 2019-02-14 05:46

I recently ran into the same problem installing rails on windows with Ruby v2.4.1 I found that removing the gemfile line:

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

then running bundle update

then putting the tzinfo-data line back in the gemfile

I could then run bundle without any issue. All is working well again.

查看更多
啃猪蹄的小仙女
4楼-- · 2019-02-14 05:48

I had the same problem as you. On Windows you need to perform an additional step:

http://www.nokogiri.org/tutorials/installing_nokogiri.html

查看更多
一夜七次
5楼-- · 2019-02-14 05:51

Install the newest version of Nokogiri. In Gemfile:

gem 'nokogiri', '~> 1.6.8.rc2'
查看更多
Rolldiameter
6楼-- · 2019-02-14 05:51

Problem solved in Done. Nokogiri 1.8.0.

查看更多
登录 后发表回答