[英]An error occurred while installing nokogiri (1.10.10), and Bundler cannot continue
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
Gem::Ext::BuildError: 错误: 无法构建 gem 原生扩展。
current directory: /home/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10/ext/nokogiri
/home/.rvm/rubies/ruby-2.7.0/bin/ruby -I /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0 -r./siteconf20210329-30335-1ed7nme.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.
/home/.rvm/rubies/ruby-2.7.0/bin/ruby -I /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0 -r./siteconf20210329-30335-1ed7nme。 rb extconf.rb --use-system-libraries 检查 C 编译器是否接受... *** extconf.rb 失败 *** 由于某种原因,可能缺少必要的库和/或头文件,无法创建 Makefile。 Check the mkmf.log file for more details.
检查 mkmf.log 文件以获取更多详细信息。 You may need configuration options.
您可能需要配置选项。
Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=.
提供的配置选项: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib -- without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/.rvm/rubies/ruby-2.7.0/bin/$(RUBY_BASE_NAME) --help --clean /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:471:in
try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in
--curdir --ruby=/home/.rvm/rubies/ruby-2.7.0/bin/$(RUBY_BASE_NAME) --help --clean /home/.rvm/rubies/ruby-2.7.0/lib/ruby /2.7.0/mkmf.rb:471:in
try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in
try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in
try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in
block in try_compile' from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:544:inwith_werror' from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in
try_compile' from extconf.rb:138:innokogiri_try_compile' from extconf.rb:162:in
block in add_cflags' from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:655:inwith_cflags' from extconf.rb:161:in
add_cflags' from extconf.rb:416:in `'try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in
block in try_compile' 来自 /home/.rvm/rubies/ruby-2.7.0/lib /ruby/2.7.0/mkmf.rb:544:inwith_werror' from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in
try_compile' 来自 extconf .rb:138:innokogiri_try_compile' from extconf.rb:162:in
block in add_cflags' from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:655:inwith_cflags' from extconf.rb:161:in
add_cflags' 来自 extconf.rb:416:in `'To see why this extension failed to compile, please check the mkmf.log which can be found here:
要查看此扩展无法编译的原因,请查看 mkmf.log,可在此处找到:
/home/.rvm/gems/ruby-2.7.0/extensions/x86_64-linux/2.7.0/nokogiri-1.10.10/mkmf.log
/home/.rvm/gems/ruby-2.7.0/extensions/x86_64-linux/2.7.0/nokogiri-1.10.10/mkmf.log
extconf failed, exit code 1
extconf 失败,退出代码 1
Gem files will remain installed in /home/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10 for inspection.
Gem 文件将继续安装在 /home/.rvm/gems/ruby-2.7.0/gems/nokogiri-1.10.10 以供检查。 Results logged to /home/.rvm/gems/ruby-2.7.0/extensions/x86_64-linux/2.7.0/nokogiri-1.10.10/gem_make.out
结果记录到 /home/.rvm/gems/ruby-2.7.0/extensions/x86_64-linux/2.7.0/nokogiri-1.10.10/gem_make.out
An error occurred while installing nokogiri (1.10.10), and Bundler cannot continue.
安装 nokogiri (1.10.10) 时出错,Bundler 无法继续。 Make sure that
gem install nokogiri -v '1.10.10' --source 'https://rubygems.org/'
succeeds before bundling.确保
gem install nokogiri -v '1.10.10' --source 'https://rubygems.org/'
在捆绑之前成功。
First, check your mkmf.log file for more details.首先,检查您的 mkmf.log 文件以获取更多详细信息。
gcc: error: unrecognized command line option '-Wduplicated-cond'
gcc: error: unrecognized command line option '-Wmisleading-indentation'
gcc: error: unrecognized command line option '-Wimplicit-fallthrough=0'
Solution : brew unlink gcc解决方案:brew unlink gcc
$ bundle install (will work fine) $ bundle install (可以正常工作)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.