尝试安装 Nokogiri 时 Rails 开发人员工具出现问题



我在尝试安装Nokogiri时收到上述错误。

我相信这个问题与 x 代码和/或 rvm 有关。我的想法是我需要卸载并重新安装一个或两个才能使其正常工作。

我的问题基于下面的错误,您认为我需要卸载并重新安装 xcode 和/或 rvm 来解决此问题?您还有什么要先尝试的吗?

任何建议/帮助将不胜感激。

以下是我得到的错误

$gem install nokogiri -- --use-system-libraries
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.
    /Users/jackburum/.rbenv/versions/2.1.2/bin/ruby -r ./siteconf20160201-5728-joih4p.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... *** 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.
/Users/jackburum/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/jackburum/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:571:in `block in try_compile'
    from /Users/jackburum/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:522:in `with_werror'
    from /Users/jackburum/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:571:in `try_compile'
    from extconf.rb:80:in `nokogiri_try_compile'
    from extconf.rb:87:in `block in add_cflags'
    from /Users/jackburum/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:621:in `with_cflags'
    from extconf.rb:86:in `add_cflags'
    from extconf.rb:336:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/jackburum/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /Users/jackburum/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/nokogiri-1.6.7.2/gem_make.out

如果您遇到此问题,我只需从我的本地 comp 应用程序打开> xcode 并同意新条款即可解决。然后我运行捆绑包,我的应用程序开始工作。

相关内容

  • 没有找到相关文章

最新更新