当我运行捆绑安装时,Nokogiri“无法构建 gem 本机扩展”

2024-05-11

我在跑bundle install我收到此错误:

Building nokogiri using system libraries.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --use-system-libraries
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --help
    --clean
    --use-system-libraries
    --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-xml2-dir
    --without-xml2-dir
    --with-xml2-include
    --without-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/lib
    --with-libxml-2.0-config
    --without-libxml-2.0-config
    --with-pkg-config
    --without-pkg-config
    --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-exslt-dir
    --without-exslt-dir
    --with-exslt-include
    --without-exslt-include=${exslt-dir}/include
    --with-exslt-lib
    --without-exslt-lib=${exslt-dir}/lib
    --with-libexslt-config
    --without-libexslt-config
    --with-pkg-config
    --without-pkg-config

extconf failed, exit code 1

Gem files will remain installed in /Users/myuser/projectpath/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.2.rc2 for inspection.
Results logged to /Users/myuser/projectpath/vendor/bundle/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/nokogiri-1.6.2.rc2/gem_make.out
An error occurred while installing nokogiri (1.6.2.rc2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2.rc2'` succeeds before bundling.

有什么想法吗?

EDIT:

我还按照以下步骤安装了 nokogiri教程中的说明 http://nokogiri.org/tutorials/installing_nokogiri.html,奇怪的是gem竟然安装成功了。当我跑步时gem list, 我有nokogiri (1.6.2.1),但是运行时bundle install它显示错误。


以前的建议对我没有帮助,这是 OS 10.9 的解决方案:

brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

当我运行捆绑安装时,Nokogiri“无法构建 gem 本机扩展” 的相关文章

随机推荐

  • 如何加快列表理解速度

    以下是我的清单 col red yellow blue red green yellow pink orange brown pink brown 我的目标是消除每个列表中出现一次的项目 这是我的代码 eliminate w for w i
  • python 函数是否应该总是返回一些值?

    当我开始使用 python 编码时 一位高级开发人员建议我放置一个return True 一般为布尔值 每当函数的作用域结束时 例如 def mytest try os system convert text pdf text jpg ex
  • Haskell 类型系统的细微差别

    我一直在深入了解 haskell 类型系统的本质 并试图了解类型类的要点 我已经学到了很多东西 但我在下面的代码片段上遇到了困难 使用这些类和实例定义 class Show a gt C a where f Int gt a instanc
  • getActivity() 是什么意思?

    什么是getActivity 意思是 我在某个地方看到 他们写道MainActivity this startActionMode mActionModeCallback 代替getActivity 有人能解释一下这两行是什么意思吗 som
  • 如何在 git 中删除 subversion 远程?

    我有一个最初使用 git svn 创建的 git 存储库 现在我有一个推送到的 git 服务器 但 svn 存储库已丢失 我可以删除 svn 远程吗 如何 您可以编辑 git config文件并删除与要删除的遥控器关联的部分 您要删除的行可
  • 比较两个包含对象的数组以计算发生了什么变化?

    使用平面 JavaScript 或使用 lodash 最简单的方法是什么 希望 lodash 有一个函数 我比较以下数组并返回已更改的值 Before id 0 name Bob age 27 id 1 name Frank age 32
  • 在 while 循环中使用 getchar() 打印一条语句两次..如何?

    我有一个非常简单的程序 如下所示 int main int opt int n int flag 1 while flag printf m inside while Press c to continue n if opt getchar
  • Environment.WorkingSet 错误地报告内存使用情况

    Environment WorkingSet 错误地报告在 Windows 2003 Server 上运行的网站的内存使用情况 操作系统版本 Microsoft Windows NT 5 2 3790 Service Pack 2 NET
  • 数据包无序。得到:80 预期:0 node.js

    这是我的 非常简单 代码 var connection mysql createConnection infosDB connection connect connection query SELECT FROM action functi
  • 安装 npm 包时自动安装类型定义

    有没有办法配置npm以这样的方式 每当我安装一个包时 它都会 检查里面是否有类型定义 如果没有 请尝试安装 types PACKAGE与 save dev flag 理想情况下 我希望这能够自动发生 作为插件或其他东西 而不需要编写限制 A
  • linux下如何获取昨天和前天?

    我想在变量中获取 sysdate 1 和 sysdate 2 并回显它 我正在使用下面的查询 它将今天的日期作为输出 bin bash tm date Y d m echo tm 如何获取昨天和前天的日期 这是另一种方法 对于昨天来说 da
  • 为什么我们必须在 OAuth 中“更改令牌凭据的临时凭据”?

    服务器不能只是将临时凭证 升级 为令牌凭证并保留相同的密钥和秘密吗 然后 客户端可以在收到服务器的回调 表明临时凭证已 升级 后立即开始进行经过身份验证的调用 当然 如果临时凭证尚未升级 即客户端不等待回调 则经过身份验证的调用将失败 所以
  • 什么时候 Thread.sleep(1000) 睡眠时间少于 1000 毫秒?

    在这篇有趣的文章中程序员对时间的看法是错误的 http infiniteundo com post 25509354022 more falsehoods programmers believe about time wisdom 其中之一
  • 使用 jQuery 修改 svg 文件

    我有一个 svg 文件 其中包含一些形状和一些文本 我想在运行时修改 svg 以便某些形状可以更改颜色 某些文本可以更改其内容 假设我的外部 svg 文件中只有两个元素 圆圈 1 具有该 id 的蓝色实心圆圈 text1 包含该 id 的
  • 下拉 Ajax onchange SonataAdminBundle Symfony2 问题

    我正在尝试在 SonataAdminBundle 中实现 onchange 下拉菜单 我的实体就像 class BuilderHomePage var integer ORM Column name id type integer null
  • 如何将 SVN 修订号注入 JAR 中?

    我希望我的 JAR WAR 应用程序知道其源代码的 SVN 修订号是多少 我希望稍后在网页底部等处为网络最终用户呈现此修订号 是否有任何现有的 Maven 插件可以自动化该过程 我认为该插件必须从以下位置收集信息svn并保存到某个文件 例如
  • 哎呀,看起来像出事了。拉拉维尔 5.1

    我有这样的路线 http localhost inspection show id 当我尝试同时加载路线时 在不同的选项卡中 有时其中一些选项卡会出现错误 哎呀 看起来出了问题 在不同选项卡中加载速度如此之快 http localhost
  • 可以在 Blazor 布局中使用 ViewComponent 吗?

    刚刚第一次尝试 Blazor 使用默认的 Blazor 模板 我添加了一个ViewComponent致电MainLayout cshtml await Component InvokeAsync HeaderComponent Intell
  • 实体框架 SaveChanges 错误详细信息

    保存更改时SaveChanges在数据上下文上有没有办法确定哪个实体导致错误 例如 有时我会忘记将日期分配给不可为空的日期字段并收到 无效日期范围 错误 但我没有得到有关它是由哪个实体或哪个字段引起的信息 我通常可以通过煞费苦心地检查我所有
  • 当我运行捆绑安装时,Nokogiri“无法构建 gem 本机扩展”

    我在跑bundle install我收到此错误 Building nokogiri using system libraries Gem Ext BuildError ERROR Failed to build gem native ext