109

我将我的 OSX (Lion) 升级到 Mavericks,但我无法为我的项目安装 Nokogiri。

我已经安装了 XCode 5.0.1、命令行工具(使用xcode-select --install),并且已经从 Homebrew 安装了 libxml2,但我仍然遇到问题。

错误是:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
checking for libxml/parser.h... *** 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
    --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=/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/bin/ruby
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --with-iconv-dir
    --without-iconv-dir
    --with-iconv-include
    --without-iconv-include=${iconv-dir}/include
    --with-iconv-lib
    --without-iconv-lib=${iconv-dir}/lib
    --with-xml2-dir
    --without-xml2-dir
    --with-xml2-include
    --without-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/lib
    --with-xslt-dir
    --without-xslt-dir
    --with-xslt-include
    --without-xslt-include=${xslt-dir}/include
    --with-xslt-lib
    --without-xslt-lib=${xslt-dir}/lib
    --with-libxslt-config
    --without-libxslt-config
    --with-pkg-config
    --without-pkg-config
    --with-libxml-2.0-config
    --without-libxml-2.0-config
    --with-libiconv-config
    --without-libiconv-config
/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
    from /Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
    from extconf.rb:116:in `<main>'


Gem files will remain installed in /Users/ericcamalionte/Locaweb/code/dns-panel/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.9 for inspection.
Results logged to /Users/ericcamalionte/Locaweb/code/dns-panel/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.9/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.5.9), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.9'` succeeds before bundling.

我从 Homebrew 安装了 libxml2、libxslt 和 libiconv,并设置了安装 Nokogiri 的参数,但也不起作用。

我找不到我的环境有什么问题,你能帮帮我吗?

4

30 回答 30

244

您还可以使用完整的 XCode 安装在 Mac OS X 10.9 Mavericks上安装 Nokogiri:

gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2

更新

对于那些使用优胜美地的人,以下命令将起作用:

gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 --use-system-libraries

或者,它实际上可能在你的MacOSX10.11.sdk文件夹中(我的文件夹是 2015 年 9 月 18 日),所以即使你还没有完全掌握 El Capitan,我最近更新了 XCode,你可能需要使用 El Capitan SDK路径,接下来是:

更新

对于那些使用El Capitan的人,以下命令将起作用:

gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries

更新

对于那些使用Sierra的人,以下命令将起作用:

gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 --use-system-libraries
于 2013-11-06T08:50:46.510 回答
30

在这里浏览动画 GIF 后,我所要做的就是简单xcode-select --installgem install nokogiri工作正常。

于 2014-02-13T05:45:05.650 回答
20

我找到了这个日志,发现没有找到gcc-4.2:

package configuration for libxslt
cflags: -I/usr/local/Cellar/libxslt/1.1.28/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2
ldflags: -L/usr/local/Cellar/libxslt/1.1.28/lib -L/usr/local/Cellar/libxml2/2.9.1/lib
libs: -lxslt -lxml2 -lz -lpthread -liconv -lm -lxml2

package configuration for libxml-2.0
cflags: -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2
ldflags: -L/usr/local/Cellar/libxml2/2.9.1/lib
libs: -lxml2

package configuration for libiconv is not found
"/usr/bin/gcc-4.2 -o conftest -I/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/x86_64-darwin11.4.0 -I/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -I/usr/local/Cellar/libxslt/1.1.28/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2 -I/usr/local/Cellar/libiconv/1.14/include -I/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxml2/2.8.0/include -I/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxslt/1.1.26/include -I/Users/ericcamalionte/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE    -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES -DNOKOGIRI_LIBXML2_PATH='"/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxml2/2.8.0"' -DNOKOGIRI_LIBXSLT_PATH='"/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxslt/1.1.26"' -I/usr/local/Cellar/libxslt/1.1.28/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2  -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2  conftest.c  -L. -L/Users/ericcamalionte/.rvm/rubies/ruby-1.9.2-p320/lib -L/usr/local/Cellar/libxslt/1.1.28/lib -L/usr/local/Cellar/libxml2/2.9.1/lib -L/usr/local/Cellar/libiconv/1.14/lib -L/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxml2/2.8.0/lib -L/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxslt/1.1.26/lib -L/Users/ericcamalionte/.rvm/usr/lib -L.  -Wl,-rpath,/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxml2/2.8.0/lib -Wl,-rpath,/Users/ericcamalionte/.rvm/gems/ruby-1.9.2-p320@dns-panel/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxslt/1.1.26/lib -L/usr/local/Cellar/libxslt/1.1.28/lib -L/usr/local/Cellar/libxml2/2.9.1/lib -L/usr/local/Cellar/libxml2/2.9.1/lib     -lxslt -lxml2 -lz -lpthread -liconv -lm -lxml2  -lxml2  -lruby.1.9.1-static  -lpthread -ldl -lobjc  "
sh: /usr/bin/gcc-4.2: No such file or directory
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */

为了解决这个问题,我使用自制软件安装了 apple-gcc42brew install apple-gcc42并创建了一个指向我的 /usr/bin 的符号链接:

sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 /usr/bin/gcc-4.2

于 2013-10-28T19:55:33.477 回答
15

If you're running Xcode 5.1, the command line tools don't work for nokogiri 1.6.1. You'll need to download the Late october 2013 tools from Apple. Once you do that run

sudo xcode-select -s /Library/Developer/CommandLineTools/

to set up your machine to use the Xcode 5.0.X command line tools, then run

gem install nokogiri

If you want to reset your command line tools to the Xcode.app version afterward run

sudo xcode-select -r

Or, another thing you can do is add the flag to ignore unknown command line arguments. Then the install looks like this:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install nokogiri
于 2014-03-28T03:56:05.873 回答
12

这就是在 OSX Mavericks 上对我有用的方法:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install nokogiri -v '1.6.1' --verbose --no-ri --no-rdoc
于 2014-05-18T08:42:44.427 回答
10

我在 OSX Mavericks 上,结果证明我的问题是 Ruby 安装错误。

所以,我用 rvm 重新安装了 ruby​​:

rvm remove ruby 2.0.0p451
rvm remove ruby-2.0.0-p451 && rvm install ruby-2.0.0-p451

然后我能够

gem install nokogiri --no-ri --no-rdoc

问题解决了。

于 2014-05-02T15:48:46.183 回答
9

我通常喜欢坚持使用系统提供的东西。这对我有用:

gem install nokogiri -- --with-iconv-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ --with-iconv-lib=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/
于 2014-08-11T01:39:37.197 回答
5

在安装了来自 Apple 的 Mavericks 10.9.5 更新和 10.9 Developer 工具更新后,我立即遇到了这个问题。我跑了xcode-select --install,但这并没有解决问题。然后我打开 XCode,接受 eula,然后退出 XCode。这解决了问题。

于 2014-09-27T20:55:47.817 回答
3

我今天在 Maverick 上遇到了这个问题,这就是我最终解决问题的方式:

brew update
brew install libiconv
brew link libiconv

确保您知道下面的 Cellar mine 中的 libiconv 版本是 1.14,然后安装如下:

gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14

如果您需要特定版本的 nokogiri 例如 -v '1.6.2.1' 然后安装为:

gem install nokogiri -v '1.6.2.1' -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14

Nokogiri 安装成功!

于 2014-09-21T07:55:39.183 回答
3

这与@thomas_witt 的帖子相同,但适用于 Mac OS X Sierra:

gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 --use-system-libraries
于 2016-10-07T13:54:14.163 回答
2

Here is another reference:

system: OS X Yosemite 10.10
rvm: 1.26.10
brew: 0.9.5
ruby: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]

I got error while installing nokogiri

error like this:

.rvm/rubies/ruby-2.2.0-p0/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)

You have to install development tools first.

then probably need:

$ xcode-select --install

or if you got error like

checking for libxml/parser.h... no

I just fix the lib path by:

gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
brew install libxml2 libxslt
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2/libxml --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/ --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26/

for bundle need something like:

bundle config build.nokogiri --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2/libxml --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/ --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26/
bundle install
于 2015-03-19T01:34:25.270 回答
2

brew install libxml2 libxslt如果您使用 Homebrew,请使用。

于 2014-07-30T07:04:50.147 回答
2

对于使用MacPorts的人,请确保您已libxml2通过MacPorts. 然后输入:

bundle config build.nokogiri --use-system-libraries
bundle install

这应该可以解决问题,在不使用完整路径的情况下为我工作。

于 2014-12-15T09:59:36.747 回答
2

为了使安装工作,我必须修改gem install命令中的文件路径以匹配我系统上的文件路径。我有不同版本的 libxml2 和 libiconv 以及稍微不同的文件结构。该命令,经过我的修改,是:

gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 
                        --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib 
                        --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 
                        --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include 
                        --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
于 2013-11-22T14:09:19.870 回答
2

这对我有用

system: OS X Yosemite 10.10
rvm: 1.26.10
ruby: ruby 2.2.1 

只需运行以下两个命令

$ xcode-select --install

它会要求你下载说“是”然后它会要求安装 xcode 组件单击安装。

现在尝试使用以下命令安装 gem

gem install nokogiri --no-ri --no-rdoc

这对我来说适用于上述环境。

于 2015-05-07T05:31:30.450 回答
1

在升级后不久遇到同样的问题后,我在这里添加了我的发现:http: //jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/

修复只是这两个命令:

xcode-select --install
gem install nokogiri

希望能帮助到你。

于 2013-12-05T21:21:54.863 回答
1
brew install libxml2 libxslt
gem install nokogiri -- \
    --with-xml2-include=/usr/local/Cellar/libxml2/*/include/libxml2 \
    --with-xml2-lib=/usr/local/Cellar/libxml2/*/lib \
    --with-xslt-dir=/usr/local/Cellar/libxslt/*
于 2014-05-26T15:03:55.897 回答
1

我为 Mavrick 遇到了同样的问题,解决方案是:

xcode-select --install

但是,这不起作用,因为Apple 的 Command-line-tool 下载页面现在没有公开提供该安装程序。

所以,如果你想拥有 Mavricks 的命令行工具,你需要有一个付费帐户。然后只有您可以安装它。一旦安装它,您将不会遇到 Nokogiri 的这个问题。

于 2013-11-26T08:09:36.853 回答
1

我在新的 Mavericks 安装中遇到了同样的错误。在判断失误后,我将我的 Xcode 应用程序包重命名为Xcode 5.0.1.app.

显然 Nokogiri 安装脚本没有引用其路径,因此文件名中的空格引起了各种麻烦。直到我尝试brew install libxml2,错误才变得明显。

经验教训:文件名中的空格是邪恶的。

于 2013-11-05T23:16:08.933 回答
1

错误消息在这里提供了一个线索:The compiler failed to generate an executable file. (RuntimeError)

xcode-select --install # not sure if this is required  
brew install apple-gcc42  
gem install nokogiri  

您可能还需要 brew install 并链接这些:

libxml2 libxslt
于 2014-05-14T10:09:44.160 回答
1

就我而言,我必须在符号链接后实际运行 /usr/bin/gcc-4.2 。您必须接受许可协议,否则它会挂起。

于 2013-12-03T08:38:54.377 回答
1

升级到 Maverick 后,我遇到了类似的问题。我将 RVM 与 Ruby 1.9.2-p320 一起使用,我尝试了这里给出的几种解决方案,但没有解决问题。

然后我改用 Ruby 2.1.2,并bundle install立即安装了 Nokogiri。

于 2014-05-30T12:10:05.550 回答
1

对我来说,错误是那个 gcc(4.2.1,从 Homebrew 安装)抱怨说:

-E, -S, -save-temps and -M options are not allowed with multiple -arch flags

我通过仅强制 x86_64 解决了这个问题:

ARCHFLAGS="-arch x86_64" gem install nokogiri 
于 2014-09-29T14:21:39.347 回答
1

如果有人在使用捆绑器时在 el capitan 上遇到此问题。

确保安装了 xcode 命令行工具并运行:

bundle config build.nokogiri --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
于 2016-01-28T08:19:11.977 回答
1

在尝试运行 rails 3 版本的应用程序时,我在过去两周遇到了同样的问题。

问题是您的 rvm/rbenv 没有使用 C 编译器。

使用此命令为 rvm 获取兼容的 C 编译器

CC=gcc rvm install-version

因此,如果您使用的是 Ruby 1.9.3,请以这种方式使用

CC=gcc rvm install-1.9.3

每次您无法捆绑安装或任何东西时,请使用此命令。 这个东西正在 El Capitan、rails 3.2.16、ruby 1.9.3、mysql 5.7 上工作,希望它能解决这个问题。

在尝试运行 rails 3 版本的应用程序时,我在过去两周遇到了同样的问题。

问题是您的 rvm/rbenv 没有使用 C 编译器。

使用此命令为 rvm 获取兼容的 C 编译器

CC=gcc rvm install-version

因此,如果您使用的是 Ruby 1.9.3,请以这种方式使用

CC=gcc rvm install-1.9.3

每次您无法捆绑安装或任何东西时,请使用此命令。

这个东西正在 El Capitan、rails 3.2.16、ruby 1.9.3、mysql 5.7 上工作,希望它能解决这个问题。 此外,如果您已经拥有 Xcode,并且在安装任何 gem 时也没有遇到相同的错误,请尝试此解决方案。

于 2016-05-24T05:02:49.490 回答
0

这些答案都不适用于我的特殊情况,而且由于我是新手,我认为我的解决方案可能能够帮助其他人。

我正在使用优胜美地并且正在使用 Ruby 1.9.3p547。p547 存在安全漏洞,因此我尝试更新到 Ruby 1.9.3p550 或更高版本。我使用了 RVM,然后尝试迁移我的 gem,但其中许多都没有迁移。然后我尝试捆绑安装,但失败了,我认为这可能是各种路径和依赖项之间的冲突,所以我删除了旧版本的 Ruby。这打破了一切。

尽管我已经下载了 XCode 并且最近更新了 CLI 工具,但我一直收到一条消息说缺少 C 编译器。我发现另一个网站告诉我下载第三方 GCC,我照做了。这让一切变得更糟。

现在我收到一条消息,说我需要修复我的配置文件和路径,否则重新安装 OSX 可能会更容易。所以我做了。

无论如何,更长的故事只是很长:最终对我有用的解决方案是摆脱 RVM 并在运行之前使用 brew 下载我想要的 Ruby 版本bundle install。安装正确版本的 Nokogiri FIRST。

brew install ruby193
sudo gem install nokogiri -v '1.6.0'
bundle install
于 2014-12-12T21:50:49.327 回答
0

我也有这个问题。运行brew doctor显示我在 /user/local/lib 中有意外的 libiconv 版本。

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libcharset.1.dylib
    /usr/local/lib/libiconv.2.dylib

所以我删除了它们,并重新编译了 libxml:

rm  /usr/local/lib/libiconv*
andromeda:nokogiri-1.6.0 Jeff$ brew install libxml2 libxslt
...
==> Summary
  /usr/local/Cellar/libxslt/1.1.28: 145 files, 3.3M, built in 36 seconds

最后,我安装了 nokogiri:

Jeff$ gem install nokogiri
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.6.0
1 gem installed
于 2013-12-08T16:15:12.810 回答
0

对于 Windows,您也可以尝试本地安装:

  1. 根据您的环境下载适当的 gem。

  2. 转到保存 gem 文件的目录。

  3. gem install --local nokogiri-1.6.3.1-x86-mingw32.gem

如果不起作用,您可以检查是否安装了 zlib 和 mingw 或正确的 c 编译器。

于 2016-01-06T00:14:07.563 回答
0

这里的每一件该死的事情都没有为我做(我没有进入 brew reinstalls,oy),但最终做到了(通过一些不相关项目的错误报告找到):

gem install nokogiri -- --use-system-libraries=true --with-xml2-include=/usr/include/libxml2

祝你好运。是的#yakshaving!

于 2017-01-03T18:34:09.443 回答
-3

检查您的命令行工具版本。设置您的机器以使用 Xcode 5.0.X 命令行工具,然后运行:

gem install nokogiri
于 2014-06-01T06:05:35.207 回答