在Windows上通过Bundler安装Nokogiri时出错 [英] Error installing Nokogiri via Bundler on Windows

查看:227
本文介绍了在Windows上通过Bundler安装Nokogiri时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows计算机上设置并运行极限启动编码dojo。

I'm trying to set up and run the Extreme Startup coding dojo on my Windows machine.

到达捆绑安装步骤时,出现以下错误消息:

When I reach the bundle install step, I get this error message:

$ 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.

根据,它应该可以工作,并且从某种意义上说可以,因为如果我发出命令 gem install nokogiri ,它可以正常工作,但会安装 nokogiri-1.6.6.2-x64-mingw32

According to the documentation for Nokogiri, it just ought to work, and in a sense, it does, because if I issue the command gem install nokogiri, it does work, but installs nokogiri-1.6.6.2-x64-mingw32.

据我了解捆绑安装的错误消息,它特别想要版本1.4.5。至少,即使安装了 nokogiri-1.6.6.2-x64-mingw32 捆绑安装仍然会失败,并出现上述错误消息。

As I understand the error message from bundle install, it specifically wants version 1.4.5. At least, even with nokogiri-1.6.6.2-x64-mingw32 installed, bundle install still fails with the above error message.

这可能是一个简单的问题,但是由于我是红宝石新手,因此可以使用一些帮助。

This is likely to be a simple problem, but since I'm a novice ruby user, I could use some help.

我已经尝试过在捆绑安装中安装Nokogiri的错误提示,但已经安装了,但是

推荐答案

此特定版本的Nokogiri在Gemfile.lock中列出。您可以删除该文件,再次运行bundle install并查看它是否有效。

This particular version of Nokogiri is listed in Gemfile.lock. You can remove that file, run bundle install again and see if it works.

这不是适当的解决方案,而是一种变通办法,但是 Gemfile.lock 中的依赖项很旧,因此它会不管怎样,刷新它们都是一件好事。

This is more a workaround than a proper solution, but dependencies in Gemfile.lock are quite old so it would be a good thing to refresh them anyway.

这篇关于在Windows上通过Bundler安装Nokogiri时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆