railsをインストールし、rails new フォルダ名にて作成したフォルダにターミナルで移動しrails sを実行したところ、下記※1のようにノコギリが見つからないからbundle installしなさい?的なエラーが出てしまいます。
※1Could not find nokogiri-1.10.10 in any of the sources
Run bundle install
to install missing gems.
もちろんbundle installを実行したところ
※2Installing nokogiri 1.10.10 with native extensions
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. のように出てしまい、上にあるエラーどうりにsudo gem install nokogiri -v '1.10.10' --source 'https://rubygems.org/' を実行してSuccessfully installed nokogiri-1.10.10 Parsing documentation for nokogiri-1.10.10 Done installing documentation for nokogiri after 1 seconds 1 gem installed とノコギリがインストールできたっぽいので再度bundle installをしてみるとまた上記の※2と同じエラーが出てグルグルしています。 下記bundle install実行時のエラーです ``` current directory: /private/var/folders/_f/__tph5z51ksdz6gc_jkvmq5c0000gn/T/bundler20200920-73331-awoxiynokogiri-1.10.10/gems/nokogiri-1.10.10/ext/nokogiri /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200920-73331-12opd1p.rb extconf.rb --use-system-libraries checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) --help --clean /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:532:in `with_werror' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile' from extconf.rb:138:in `nokogiri_try_compile' from extconf.rb:162:in `block in add_cflags' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:643:in `with_cflags' from extconf.rb:161:in `add_cflags' from extconf.rb:416:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /var/folders/_f/__tph5z51ksdz6gc_jkvmq5c0000gn/T/bundler20200920-73331-awoxiynokogiri-1.10.10/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.10/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /var/folders/_f/__tph5z51ksdz6gc_jkvmq5c0000gn/T/bundler20200920-73331-awoxiynokogiri-1.10.10/gems/nokogiri-1.10.10 for inspection. Results logged to /var/folders/_f/__tph5z51ksdz6gc_jkvmq5c0000gn/T/bundler20200920-73331-awoxiynokogiri-1.10.10/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.10/gem_make.out 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. In Gemfile: rails was resolved to 5.1.7, which depends on actioncable was resolved to 5.1.7, which depends on actionpack was resolved to 5.1.7, which depends on actionview was resolved to 5.1.7, which depends on rails-dom-testing was resolved to 2.0.3, which depends on nokogiri ``` 各バージョンは以下の通りです。 rubyはruby 2.6.3 rails はRails 5.1.3 SQLite3 3.28.0 Bundler version 1.17.2 ここからどうすれば良いか申し訳ありませんがご教授お願いいたします。 追加 解決した方法 gem updateを実行 ↓ xcodeをインストール(インストール済みでした) ↓ bundle installを実行 サクセス! ↓ rails sを実行すると 何やらwarning: already initialized constant Forwardable::VERSION〜〜〜〜〜〜〜とか出てきたが https://qiita.com/zQmjRAb73seN5RM/items/ecb9e19ee8f3e9af6018 を参考にし解決 ↓ 再び rails sを実行すると JavaScriptの何かでエラーが出たためnode.jsをインストール ↓ rails s 成功 localhost:3000で 起動確認 でした!!ありがとうございます!!
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2020/09/19 21:53