gpt4 book ai didi

ruby - 尝试更新 nokogiri gem 时出现错误消息

转载 作者:数据小太阳 更新时间:2023-10-29 08:57:23 26 4
gpt4 key购买 nike

尝试更新 Nokogiri gem 时出现错误消息:

The dependency wdm (~> 0.1.0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32. To add those platforms to the bundle, run bundle lock --add-platform x86-mswin32
x86-mingw32
. The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform
x86-mswin32 x86-mingw32 java
. Fetching gem metadata from http://rubygems.org/.............. Fetching gem metadata from http://rubygems.org/.. Resolving dependencies... Using i18n 0.7.0 Using json 1.8.3 Using minitest 5.7.0 Using thread_safe 0.3.5 Using tzinfo 1.2.2 Using activesupport 4.1.11 Using addressable 2.3.8 Using execjs 2.5.2 Using autoprefixer-rails 5.2.1 Using sass 3.4.15 Using bootstrap-sass 3.3.5 Using bundler 1.16.0 Using hitimes 1.2.2 Using timers 4.0.1 Using celluloid 0.16.0 Using chunky_png 1.3.4 Using coffee-script-source 1.9.1.1 Using coffee-script 2.4.1 Using multi_json 1.11.1 Using compass-core 1.0.3 Using compass-import-once 1.0.5 Using rb-fsevent 0.9.5 Using ffi 1.9.8 Using rb-inotify 0.9.5 Using compass 1.0.3 Using eventmachine 1.0.7 Using http_parser.rb 0.6.0 Using em-websocket 0.5.1 Using erubis 2.7.0 Using font-awesome-sass 4.2.2 Using tilt 1.4.1 Using haml 4.0.6 Using hike 1.2.3 Using uber 0.0.13 Using hooks 0.4.0 Using htmlcompressor 0.2.0 Using thor 0.19.1 Using jquery-middleman 3.1.2 Using kramdown 1.7.0 Using listen 2.10.1 Using padrino-support 0.12.5 Using padrino-helpers 0.12.5 Using rack 1.6.4 Using rack-test 0.6.3 Using middleman-core 3.3.12 Using sprockets 2.12.3 Using sprockets-helpers 1.1.0 Using sprockets-sass 1.3.1 Using middleman-sprockets 3.4.2 Using uglifier 2.7.1 Using middleman 3.3.12 Using middleman-blog 3.5.3 Using net-ssh 2.9.2 Using net-sftp 2.1.2 Using ptools 1.3.2 Using middleman-deploy 1.0.0 Using middleman-disqus 1.1.0 Using rack-livereload 0.3.15 Using middleman-livereload 3.1.1 Using middleman-minify-html 3.4.1 Using middleman-protect-emails 0.3.1 Using mini_portile2 2.3.0 Fetching nokogiri 1.8.2 (was 1.6.6.4) Installing nokogiri 1.8.2 (was 1.6.6.4) with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/nokogiri-1.8.2/ext/nokogiri

/usr/local/var/rbenv/versions/2.2.2/bin/ruby -r ./siteconf20180130-47766-zngdwi.rb extconf.rb 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.

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=. --curdir --ruby=/usr/local/var/rbenv/versions/2.2.2/bin/$(RUBY_BASE_NAME) --help --clean /usr/local/var/rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file.
(RuntimeError) You have to install development tools first. from
/usr/local/var/rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:571:in
block in try_compile' from /usr/local/var/rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:522:in with_werror' from
/usr/local/var/rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:571:in
try_compile' from extconf.rb:138:in nokogiri_try_compile' from
extconf.rb:162:in
block in add_cflags' from /usr/local/var/rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:619:in with_cflags' from extconf.rb:161:inadd_cflags' from extconf.rb:410:in `'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/nokogiri-1.8.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/nokogiri-1.8.2 for inspection. Results logged to /usr/local/var/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/nokogiri-1.8.2/gem_make.out

An error occurred while installing nokogiri (1.8.2), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.8.2' succeeds before bundling.

In Gemfile: nokogiri

最佳答案

这对我在 WSL 上运行 Ubuntu 有帮助:

sudo apt-get install build-essential patch ruby​​-dev zlib1g-dev liblzma-dev

来自 official Nokogiri installation instructions

对于 Mac OS,它建议:

  1. 首先,确保您拥有最新版本的 RubyGems 和 xcode 命令行工具:

  2. 运行:

gem update --system

xcode-select --install

  1. 然后安装 nokogiri:

gem 安装 nokogiri

该页面上有更多故障排除提示。

关于ruby - 尝试更新 nokogiri gem 时出现错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48524978/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com