前提・実現したいこと
Railsで作成中のアプリケーションがあるのですが、
今朝MACのOSをアップデートしてから、rails s コマンドが通りません。
これを何とかしたいです。
原因はnokogiriが見つからないと言われているので、
まずはnokogiriのインストールをしたいのですが、これができていない状態です。
発生している問題・エラーメッセージ
■ rails s が通らないエラーメッセージ $ rails s Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25 Ignoring ffi-1.9.18 because its extensions are not built. Try: gem pristine ffi --version 1.9.18 Ignoring nio4r-2.3.1 because its extensions are not built. Try: gem pristine nio4r --version 2.3.1 Ignoring nio4r-2.2.0 because its extensions are not built. Try: gem pristine nio4r --version 2.2.0 Ignoring nokogiri-1.8.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.8.2 Ignoring nokogiri-1.8.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.8.1 Ignoring pg-0.20.0 because its extensions are not built. Try: gem pristine pg --version 0.20.0 Ignoring puma-3.11.4 because its extensions are not built. Try: gem pristine puma --version 3.11.4 Ignoring puma-3.11.2 because its extensions are not built. Try: gem pristine puma --version 3.11.2 Could not find nokogiri-1.8.4 in any of the sources Run `bundle install` to install missing gems.
試したこと
まずはbundle installを実施、その際にもエラーが発生しました。
■ bundle install をした時のエラーメッセージ(一部を抜粋)
An error occurred while installing nokogiri (1.8.4), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.8.4'` succeeds before bundling.
続いて、指示の通りnokogiriをインストールしようと思ったのですが、書き込み権限がないとのことで弾かれたので、管理者権限を使って実施しました。
■ 管理者権限でnokogiriをインストールした際のエラーメッセージ(全て)
$ sudo gem install nokogiri -v '1.8.4' Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. current directory: /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.8.4/ext/nokogiri /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181028-3976-vsowa5.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=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME) --help --clean /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456: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.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:522:in `with_werror' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.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 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:629:in `with_cflags' from extconf.rb:161:in `add_cflags' from extconf.rb:410:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/nokogiri-1.8.4/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.8.4 for inspection. Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/nokogiri-1.8.4/gem_make.out
実施した内容はここまでで、ここから先何をすれば良いか全くわからなくなってしまったため、質問になります。
どなたかご教授いただけないでしょうか。。。
よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/31 13:16