railsで新しいプロジェクトを作成しようとし、
rails new ○○ -d mysql
を実行したあとそのディレクトリ移動し
gemファイルを gem 'mysql2', '0.3.18' に書き換えてbundle installをしたのですが、以下のようなエラーが出てしまい先に進めません。
どなたかよろしくお願いいたします。
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /Users/Hiroki/.rbenv/versions/2.1.3/bin/ruby extconf.rb checking for ruby/thread.h... *** 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/Hiroki/.rbenv/versions/2.1.3/bin/ruby /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.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/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:321:in `open' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:321:in `open' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:347:in `postpone' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for' from /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header' from extconf.rb:9:in `<main>' extconf failed, exit code 1 Gem files will remain installed in /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/mysql2-0.3.18 for inspection. Results logged to /Users/Hiroki/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/mysql2-0.3.18/gem_make.out An error occurred while installing mysql2 (0.3.18), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.3.18'` succeeds before bundling.
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。