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

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

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

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

Q&A

0回答

1126閲覧

bundle install実行時、nokogiriにより正常に動作しない

snafkin1919

総合スコア4

Ruby on Rails

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

0グッド

0クリップ

投稿2020/03/19 11:45

前提・実現したいこと

#bundle installを実行するとnokogiriでエラーが出てしまいます。

初心者です。
railsでGemfileを入れようとした矢先つまづいてしまい、ググってみたのですが、何が問題点なのか分からずじまいでして・・・

質問させて頂きました。

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is inst
alling for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x
86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock -- add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Using rake 13.0.1
Using concurrent-ruby 1.1.6
Using i18n 1.8.2

Using minitest 5.14.0
Using thread_safe 0.3.6
Using tzinfo 1.2.6
Using activesupport 5.2.4.1
Using builder 3.2.4
Using erubi 1.9.0
Using mini_portile2 2.4.0
Fetching nokogiri 1.10.9
Installing nokogiri 1.10.9 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/name/chat_app/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.9/ext/nokogiri
/Users/name/.rbenv/versions/2.5.0/bin/ruby -r
./siteconf20200319-17600-18sohmk.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=/Users/name/.rbenv/versions/2.5.0/bin/$(RUBY_BASE_NAME)
--help
--clean
/Users/name/.rbenv/versions/2.5.0/lib/ruby/2.5.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/name/.rbenv/versions/2.5.0/lib/ruby/2.5.0/mkmf.rb:574:in block in
try_compile'

from /Users/name/.rbenv/versions/2.5.0/lib/ruby/2.5.0/mkmf.rb:521:in
with_werror' from /Users/name/.rbenv/versions/2.5.0/lib/ruby/2.5.0/mkmf.rb:574:in try_compile'
from extconf.rb:138:in nokogiri_try_compile' from extconf.rb:162:in block in add_cflags'
from /Users/name/.rbenv/versions/2.5.0/lib/ruby/2.5.0/mkmf.rb:632: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:

/Users/name/chat_app/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-18/2.5.0-
static/nokogiri-1.10.9/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/Users/name/chat_app/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.9 for
inspection.
Results logged to
/Users/name/chat_app/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-18/2.5.0-
static/nokogiri-1.10.9/gem_make.out

An error occurred while installing nokogiri (1.10.9), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.10.9' --source 'https://rubygems.org/'
succeeds before bundling.

In Gemfile:
rails was resolved to 5.2.4.1, which depends on
actioncable was resolved to 5.2.4.1, which depends on
actionpack was resolved to 5.2.4.1, which depends on
actionview was resolved to 5.2.4.1, which depends on
rails-dom-testing was resolved to 2.0.3, which depends on
nokogiri

もし、ご存知の方いらっしゃしましたらご指摘・参考になるサイトをご紹介いただければ幸いです。
何卒よろしくお願いいたします。

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

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

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

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

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

snafkin1919

2020/03/24 10:38

ご連絡ありがとうございました。 上記の方法で無事に解決できました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問