如何在 Windows 上安装 Nokogiri 1.6.7.2
How to install Nokogiri 1.6.7.2 on Windows
我阅读了 Stack Overflow 上的各个页面,但没有找到使用 Ruby 2.3.0.
安装 Nokogiri 1.6.7.2 的解决方案
我安装了 Ruby 2.3.0 和 DevKit,但我仍然无法 运行 bundle install
。它总是显示:
"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."
我 运行 以下 devkit 命令:
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
其中 运行 成功,所有 Ruby 版本显示。
C:/Ruby200
C:/Ruby22
C:/Ruby23
我也安装了 Ruby 2.2.4 但是当我 运行 bundle install
它显示:
ERROR: Error installing nokogiri:
nokogiri requires Ruby version < 2.3, >= 1.9.2.
我用的是Windows7 32位系统
Nokogiri 1.6.7.2 不是 the latest version。
在您的 gemfile 中将 "Nokogiri gem" 行替换为:
gem 'nokogiri', '~> 1.6.8.rc3'
在Nokogiri issue #1456中我找到了一个可能的解决方案。
首先,使用 gem uninstall nokogiri
.
卸载所有 Nokogiri 版本
运行 这些命令顺序为:
gem install nokogiri -v '1.6.6.4'
gem install rails
gem install nokogiri -v '1.6.8.rc3'
然后,打开你的 Gemfile 并添加
gem 'nokogiri', '>=1.6.8.rc3'
然后运行
bundle install
bundle update
这是用户okeyparking的解决方案,不是我的。我建议你也阅读线程。
我阅读了 Stack Overflow 上的各个页面,但没有找到使用 Ruby 2.3.0.
安装 Nokogiri 1.6.7.2 的解决方案我安装了 Ruby 2.3.0 和 DevKit,但我仍然无法 运行 bundle install
。它总是显示:
"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."
我 运行 以下 devkit 命令:
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
其中 运行 成功,所有 Ruby 版本显示。
C:/Ruby200
C:/Ruby22
C:/Ruby23
我也安装了 Ruby 2.2.4 但是当我 运行 bundle install
它显示:
ERROR: Error installing nokogiri:
nokogiri requires Ruby version < 2.3, >= 1.9.2.
我用的是Windows7 32位系统
Nokogiri 1.6.7.2 不是 the latest version。
在您的 gemfile 中将 "Nokogiri gem" 行替换为:
gem 'nokogiri', '~> 1.6.8.rc3'
在Nokogiri issue #1456中我找到了一个可能的解决方案。
首先,使用 gem uninstall nokogiri
.
运行 这些命令顺序为:
gem install nokogiri -v '1.6.6.4'
gem install rails
gem install nokogiri -v '1.6.8.rc3'
然后,打开你的 Gemfile 并添加
gem 'nokogiri', '>=1.6.8.rc3'
然后运行
bundle install
bundle update
这是用户okeyparking的解决方案,不是我的。我建议你也阅读线程。