前提・実現したいこと
bundle install により、Gemfile内に記載しているbundle 'devise' bundle 'kaminari'をインストールしたい
ここに質問の内容を詳しく書いてください。
現在、VScodeを用いwebpage開発に取り組んでいます。言語はRubyです。ログイン機能、ページ遷移を実行するためにbundle 'devise' bundle 'kaminari'をインストールしたいのですが、Gemfileに上記二つを記載し、terminalでbundle installと入力してもエラーがでます。原因、解決方法を教えてください。
発生している問題・エラーメッセージ
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
An error occurred while installing nokogiri (1.10.10), and Bundler
cannot continue.
Make sure that gem install nokogiri -v '1.10.10' --source 'https://rubygems.org/'
succeeds before bundling.
エラーメッセージ
該当のソースコード
Ruby
1ソースコード 2gem 'devise' 3 4gem 'kaminari' 5 6### 試したこと 7 8nokogiriがインストールされていないのかと思いmkmf.logを確認しましたがインストールされているようです。念のためnokogiriをインストールするためにGemfile内にnokogiriをインストールするコードを書き、bundle install を実行しましたが、全く同じエラーがでます。 9また、Xcode-select --installや、gem install rails -v 5.2.1を試しましたが駄目でした。 10 11### 補足情報(FW/ツールのバージョンなど) 12 13出てきたエラーコードを含むすべてを念のため全て掲載します。 14The 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-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. 15Fetching gem metadata from https://rubygems.org/............ 16Fetching gem metadata from https://rubygems.org/. 17Resolving dependencies... 18Using rake 13.0.1 19Using concurrent-ruby 1.1.7 20Using i18n 1.8.5 21Using minitest 5.14.1 22Using thread_safe 0.3.6 23Using tzinfo 1.2.7 24Using zeitwerk 2.4.0 25Using activesupport 6.0.3.2 26Using builder 3.2.4 27Using erubi 1.9.0 28Using mini_portile2 2.4.0 29Fetching nokogiri 1.10.10 30Installing nokogiri 1.10.10 with native extensions 31Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 32 33current directory: 34/Users/yamaguchikanako/sample/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.10.10/ext/nokogiri 35/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I 36/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r 37./siteconf20200815-36001-umefkn.rb extconf.rb --use-system-libraries 38checking if the C compiler accepts -I 39/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... *** 40extconf.rb failed *** 41Could not create Makefile due to some reason, probably lack of necessary 42libraries and/or headers. Check the mkmf.log file for more details. You may 43need configuration options. 44 45Provided configuration options: 46 --with-opt-dir 47 --without-opt-dir 48 --with-opt-include 49 --without-opt-include=${opt-dir}/include 50 --with-opt-lib 51 --without-opt-lib=${opt-dir}/lib 52 --with-make-prog 53 --without-make-prog 54 --srcdir=. 55 --curdir 56--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) 57 --help 58 --clean 59/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in 60`try_do': The compiler failed to generate an executable file. (RuntimeError) 61You have to install development tools first. 62from 63/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in 64`block in try_compile' 65from 66/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:532:in 67`with_werror' 68from 69/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in 70`try_compile' 71 from extconf.rb:138:in `nokogiri_try_compile' 72 from extconf.rb:162:in `block in add_cflags' 73from 74/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:643:in 75`with_cflags' 76 from extconf.rb:161:in `add_cflags' 77 from extconf.rb:416:in `<main>' 78 79To see why this extension failed to compile, please check the mkmf.log which can 80be found here: 81 82/Users/yamaguchikanako/sample/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.10/mkmf.log 83 84extconf failed, exit code 1 85 86Gem files will remain installed in 87/Users/yamaguchikanako/sample/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.10.10 for 88inspection. 89Results logged to 90/Users/yamaguchikanako/sample/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.10/gem_make.out 91 92An error occurred while installing nokogiri (1.10.10), and Bundler 93cannot continue. 94Make sure that `gem install nokogiri -v '1.10.10' --source 95'https://rubygems.org/'` succeeds before bundling. 96 97In Gemfile: 98 rails was resolved to 6.0.3.2, which depends on 99 actioncable was resolved to 6.0.3.2, which depends on 100 actionpack was resolved to 6.0.3.2, which depends on 101 actionview was resolved to 6.0.3.2, which depends on 102 rails-dom-testing was resolved to 2.0.3, which depends on 103 nokogiri
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。