ruby-on-rails – 运行Bundle Install时Nokogiri v 1.8.1问题

运行Bundle Install或Gem Install Nokogiri时,我遇到了阻止我的应用程序运行的相同问题.我怀疑这个问题是本地的,并且来自将所有内容都移到Rails 5,但我不确定.这是错误消息:
An error occurred while installing nokogiri (1.8.1),and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.1'` succeeds before bundling.

In Gemfile:
  rails_admin was resolved to 1.2.0,which depends on
    rails was resolved to 5.1.3,which depends on
      actioncable was resolved to 5.1.3,which depends on
        actionpack was resolved to 5.1.3,which depends on
          actionview was resolved to 5.1.3,which depends on
            rails-dom-testing was resolved to 2.0.3,which depends on
              nokogiri

(来自运行Bundle Install)
我已经尝试运行Bundle Update并使用Gi​​thub推荐的各种Homebrew命令,但我没有取得任何成功.

gem install nokogiri -v’1.8.1′

1 error generated.
make[2]: *** [xmlIO.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
========================================================================
*** 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.

解决方法

Nokogiri无法正常构建,因为您没有像libxml2这样的开发库.查看日志文件以查看发生的情况或尝试使用brew install libxml2直接安装libxml2

请参阅Nokogiry在http://www.nokogiri.org/tutorials/installing_nokogiri.html提供的引导指南

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...