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

时间:2016-02-02 00:06:41

标签: ruby-on-rails ruby rvm nokogiri

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

我认为这个问题与x-code和/或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

1 个答案:

答案 0 :(得分:0)

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