【发布时间】:2015-08-26 21:55:28
【问题描述】:
我正在尝试在我的 Windows 机器上设置和运行 Extreme Startup 编码道场。
当我到达bundle install 步骤时,我收到以下错误消息:
$ bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing builder 3.2.2
Installing nokogiri 1.4.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
c:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150826-3512-ilnke5.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=c:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
extconf failed, exit code 1
Gem files will remain installed in c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.4.5 for inspection.
Results logged to c:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/nokogiri-1.4.5/gem_make.out
An error occurred while installing nokogiri (1.4.5), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.4.5'` succeeds before bundling.
根据documentation for Nokogiri,它应该可以工作,从某种意义上说,它确实可以,因为如果我发出命令gem install nokogiri,它确实工作,但安装nokogiri-1.6.6.2-x64-mingw32 .
据我了解来自bundle install 的错误消息,它特别想要版本 1.4.5。至少,即使安装了nokogiri-1.6.6.2-x64-mingw32,bundle install 仍然会失败并显示上述错误消息。
这可能是一个简单的问题,但由于我是 ruby 新手,我可以使用一些帮助。
我已经尝试过Error installing Nokogiri on bundle install but already installed 的建议,但都没有奏效。
【问题讨论】:
-
stackoverflow.com/q/30322935/123527 是一个可能的解决方案吗?
-
@SimoneCarletti 谢谢,但
rake install_deps步骤在我的机器上失败了。已接受的答案已被编辑以表明它不起作用。 -
此特定版本的 Nokogiri 在
Gemfile.lock中列出。您可能可以尝试删除该文件,再次运行bundle install并查看它是否有效。 -
@katafrakt 这似乎有效!添加您的评论作为答案,我会接受它作为 the 答案:) 谢谢。
-
请注意,Nokogiri 还没有用于 Ruby 2.2.X 的二进制文件。因此,除非您签出 master 并构建它(最近在 Windows 上启用构建),否则您将不得不降级到 Ruby 2.1.X。抱歉我没早点讲到这个=/