質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Q&A

解決済

1回答

1058閲覧

nokogiriエラーでrails serverが起動できない(MacOS ver.up以降)

sekiya4019

総合スコア13

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

0グッド

0クリップ

投稿2018/10/28 09:07

前提・実現したいこと

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

実施した内容はここまでで、ここから先何をすれば良いか全くわからなくなってしまったため、質問になります。
どなたかご教授いただけないでしょうか。。。

よろしくお願い致します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

https://qiita.com/omega999/items/cd0420aae064cfddc725
こちらのページの、必須ファイルのインストールは試されましたでしょうか?

投稿2018/10/31 10:35

space-hippy

総合スコア136

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

sekiya4019

2018/10/31 13:16

解決しました!ありがとうございました!! brew をupdateして、brew doctor にて出てきた問題を一つづつ解消したら、解決できました!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問