ターミナルでbundle installをすると、nokogiriのエラーが発生します。
いろいろ調べてみたのですが、有名な(?)エラーみたいですね。
いくつも試してみたのですが、エラーが解決できません。
環境によって解決策がちがうと思いますが、おわかりの方がいればぜひご教授ください。
bundle install Fetching gem metadata from https://rubygems.org/.......... Using rake 11.2.2 Using i18n 0.7.0 Using json 1.8.3 Using minitest 5.9.0 Using thread_safe 0.3.5 Using tzinfo 1.2.2 Using activesupport 4.2.1 Using builder 3.2.2 Using erubis 2.7.0 Using mini_portile2 2.1.0 Using pkg-config 1.1.7 Fetching nokogiri 1.6.8 Installing nokogiri 1.6.8 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/ayumu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri /Users/ayumu/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20171210-9155-65uo26.rb extconf.rb --use-system-libraries --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config Using pkg-config version 1.1.7 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=/Users/ayumu/.rbenv/versions/2.3.1/bin/$(RUBY_BASE_NAME) --help --clean /Users/ayumu/.rbenv/versions/2.3.1/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 /Users/ayumu/.rbenv/versions/2.3.1/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile' from /Users/ayumu/.rbenv/versions/2.3.1/lib/ruby/2.3.0/mkmf.rb:522:in `with_werror' from /Users/ayumu/.rbenv/versions/2.3.1/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 /Users/ayumu/.rbenv/versions/2.3.1/lib/ruby/2.3.0/mkmf.rb:629:in `with_cflags' from extconf.rb:161:in `add_cflags' from extconf.rb:414:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/ayumu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0-static/nokogiri-1.6.8/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Users/ayumu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8 for inspection. Results logged to /Users/ayumu/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0-static/nokogiri-1.6.8/gem_make.out An error occurred while installing nokogiri (1.6.8), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.6.8'` succeeds before bundling. In Gemfile: rails was resolved to 4.2.6, which depends on actionmailer was resolved to 4.2.1, which depends on actionpack was resolved to 4.2.1, which depends on actionview was resolved to 4.2.1, which depends on rails-dom-testing was resolved to 1.0.7, which depends on nokogiri
お使いの環境と「いくつも試してみた」の内容と結果を質問に追記していただけないでしょうか?