简体   繁体   English

安装 nokogiri (1.10.10) 时出错,Bundler 无法继续

[英]An error occurred while installing nokogiri (1.10.10), and Bundler cannot continue

  • Os: Ubuntu 18.04操作系统:Ubuntu 18.04
  • ruby: 2.7 ruby:2.7
  • rails: 6.*导轨:6.*

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:in with_werror' from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in try_compile' from extconf.rb:138:in nokogiri_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:in with_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:in with_werror' from /home/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/mkmf.rb:597:in try_compile' 来自 extconf .rb:138:in nokogiri_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:in with_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.

相关问题 安装 nokogiri (1.6.0) 时出错,Bundler 无法继续 - An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue 安装 nokogiri (1.6.6.2) 时出错,Bundler 无法继续 - An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue Nitrous.IO - 安装rspec并且无法安装 - 安装nokogiri(1.6.0)时出错,Bundler无法继续 - Nitrous.IO - Installing rspec and it fails to install - An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue 安装atomic(1.1.16)时发生错误,Bundler无法继续 - An error occurred while installing atomic (1.1.16) and Bundler cannot continue 安装RedCloth(4.2.7)时发生错误,并且Bundler无法继续 - An error occurred while installing RedCloth (4.2.7), and Bundler cannot continue 安装mysql(2.9.1)时出错,Bundler无法继续 - An error occurred while installing mysql (2.9.1), and Bundler cannot continue 安装mysql(2.9.1)时发生错误,Bundler无法继续 - An error occurred while installing mysql (2.9.1) and Bundler cannot continue n在安装atomic(1.1.14)时发生错误,并且Bundler无法继续 - n error occurred while installing atomic (1.1.14), and Bundler cannot continue 安装curb(0.8.5)时发生错误,Bundler无法继续 - An error occurred while installing curb (0.8.5), and Bundler cannot continue 安装 json (1.7.6) 时出错,Bundler 无法继续。 - An error occurred while installing json (1.7.6), and Bundler cannot continue.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM