ruby-on-rails – 运行软件包安装时的Nokogiri错误

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 运行软件包安装时的Nokogiri错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
尝试获取克隆的Rails应用程序运行.当运行捆绑安装我得到这个错误
Using mini_portile (0.5.0)
Installing nokogiri (1.6.0)
Gem::InstallError: nokogiri requires Ruby version >= 1.9.2.
An error occurred while installing nokogiri (1.6.0),and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.

但这是rbenv版本的输出

› rbenv version
1.9.3-p429 (set by /Users/andrewguo/.rbenv/version)

运行宝石列表时,我得到:

.
.
.
mini_portile (0.5.0)
minitest (2.5.1)
multi_json (1.7.7)
nokogiri (1.6.0)

我一直在摇摆我的大脑一个小时,现在试图找出可能是错误的…请帮助!

编辑:

这是一个更详细的错误输出

An error occurred while installing nokogiri (1.6.0),and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
Bundler::InstallError: An error occurred while installing nokogiri (1.6.0),and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/installer.rb:130:in `install_gem_from_spec'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/installer.rb:91:in `run'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/installer.rb:90:in `run'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `__send__'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/bin/bundle:20
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/bin/bundle:20
/usr/bin/bundle:19:in `load'
/usr/bin/bundle:19

解决方法

我遇到这个错误,这对我有用:
bundle config build.nokogiri --use-system-libraries
bundle install

问题是libxml:

libxml2 is missing.  Please locate mkmf.log to investigate how it is failing.
原文链接:https://www.f2er.com/ruby/273463.html

猜你在找的Ruby相关文章