我將Ruby從2.3升級到2.4。當我運行包,我得到如何在Ruby 2.4和Nokogiri 1.8.1上使用Rails 5.0.6在Windows上工作?
C:\Users\Chloe\workspace>bundle
Fetching gem metadata from https://rubygems.org/.........
Gem::InstallError: nokogiri requires Ruby version < 2.4, >= 2.1.0.
An error occurred while installing nokogiri (1.7.0.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.0.1'` succeeds before bundling.
In Gemfile:
nested_form_fields was resolved to 0.8.2, which depends on
rails was resolved to 5.0.2, which depends on
actioncable was resolved to 5.0.2, which depends on
actionpack was resolved to 5.0.2, which depends on
actionview was resolved to 5.0.2, which depends on
rails-dom-testing was resolved to 2.0.2, which depends on
nokogiri
但是,我能夠與gem install rails --version 5.0.6
手動安裝Rails。它安裝了Nokogiri 1.8.1。 (我也裝了,然後取出的Rails 5.0.2。)
C:\Users\Chloe\workspace>gem list nokogiri
*** LOCAL GEMS ***
nokogiri (1.8.1 x64-mingw32)
然而,bundle
和rails -v
仍然無法工作。
C:\Users\Chloe\workspace>rails -v
Could not find nokogiri-1.7.0.1-x64-mingw32 in any of the sources
Run `bundle install` to install missing gems.
Gemfile
gem 'rails', '~> 5.0.2'
ruby '~> 2.4.0'
...
錯誤是'寶石:: InstallError:引入nokogiri要求Ruby版本< 2.4, > = 2.1.0'。嘗試解鎖'nested_form_fields'的版本,看看這是否使nokogiri解決了一個版本,支持紅寶石2.4 – nicooga
嗯,這不是我的項目。這是它的['Gemfile'](https://github.com/ncri/nested_form_fields/blob/master/Gemfile)和['nested_form_fields.gemspec'](https://github.com/ncri/nested_form_fields/blob/主/ nested_form_fields.gemspec)。它實際上指定'nokogiri','1.6.8.1'。 – Chloe