尝试安装 Nokogiri 时 Rails 开发者工具出现问题
Issue with Rails developer tools when trying to install Nokogiri
我在尝试安装 Nokogiri 时遇到上述错误。
我认为这个问题与 x-code and/or rvm 有关。我的想法是我需要卸载并重新安装其中一个或两个才能使其正常工作。
我的问题是基于下面的错误你认为我需要卸载并重新安装 xcode and/or rvm 来解决这个问题?您还有其他要先尝试的吗?
非常感谢advice/help。
下面是我得到的错误
$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 并同意新条款即可解决。然后我 运行 捆绑并且我的应用程序开始工作。
我在尝试安装 Nokogiri 时遇到上述错误。
我认为这个问题与 x-code and/or rvm 有关。我的想法是我需要卸载并重新安装其中一个或两个才能使其正常工作。
我的问题是基于下面的错误你认为我需要卸载并重新安装 xcode and/or rvm 来解决这个问题?您还有其他要先尝试的吗?
非常感谢advice/help。
下面是我得到的错误
$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 并同意新条款即可解决。然后我 运行 捆绑并且我的应用程序开始工作。