在执行gem install rails -v 5.0.0时出错:
bogon:~ jinzesu$ gem install rails -v 5.0.0
Building native extensions. This could take a while…
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /Users/jinzesu/.rvm/gems/ruby-2.3.1/gems/nokogiri-1.10.1/ext/nokogiri
/Users/jinzesu/.rvm/rubies/ruby-2.3.1/bin/ruby -I /Users/jinzesu/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0 -r ./siteconf20190302-2602-fo4900.rb extconf.rb
checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2… yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future… no
Building nokogiri using packaged libraries.
*** 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.
Provided configuration options:
–with-opt-dir
–with-opt-include
–without-opt-include=opt−dir/include−−with−opt−lib−−without−opt−lib={opt-dir}/include --with-opt-lib --without-opt-lib=

在尝试使用gem install rails -v 5.0.0安装Rails时遇到错误,提示未能构建本地gem扩展。错误源于C编译器无法接受某些配置选项,导致nokogiri扩展无法创建Makefile。可能需要检查必要的库和头文件,或者提供配置选项。
最低0.47元/天 解锁文章
1321





