在运行 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 Update 并使用 Github 推荐的各种 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
关于ruby-on-rails - 运行捆绑安装时出现 Nokogiri v 1.8.1 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47038472/