use*_*101 9 ruby-on-rails nokogiri
当运行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
Run Code Online (Sandbox Code Playgroud)
(这来自运行Bundle Install)我尝试运行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.
Run Code Online (Sandbox Code Playgroud)
小智 12
(对于UBUNTU)首先尝试这样做
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzmadev
Run Code Online (Sandbox Code Playgroud)
然后尝试安装.
Nokogiri无法正常构建,因为你没有像libxml2这样的开发库.查看日志文件以查看发生了什么或尝试直接安装libxml2brew install libxml2
请参阅Nokogiry在http://www.nokogiri.org/tutorials/installing_nokogiri.html提供的引导指南
我只是发布找到的解决方案(我在MacOS上也遇到了同样的问题)。这样,将使用系统库来安装gem,这将解决您遇到的问题。
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
Run Code Online (Sandbox Code Playgroud)
bundle config build.nokogiri --use-system-libraries
bundle install
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
16210 次 |
最近记录: |