Just updated to macOS Mojave, reinstalled mysql via brew & downloaded latest xcode 9.2 . While triying to setup a development enviroment for an old rails project, bundle crashes on installation of mysql2 gem. In the beggining i thought it was because latest mysql2 version, is not compatible with ruby 1.9 so i tried:
gem install mysql2 -v '0.3.17'
and i received:
/Users/me/.rvm/rubies/ruby-1.9.3-p125/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 --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/me/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in
try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:506:in
try_cpp' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:931:inblock in have_header' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in
block in checking_for' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:inblock (2 levels) in postpone' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in
open' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:inblock in postpone' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in
open' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:inpostpone' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in
checking_for' from /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:930:inhave_header' from extconf.rb:9:in
'
copy from /Users/me/.rvm/gems/ruby-1.9.3-p125@mailcatcher/gems/mysql2-0.2.18/ext/mysql2/mkmf.log:
"/usr/bin/gcc-4.2 -o conftest -I/Users/me/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/x86_64-darwin10.8.0 -I/Users/me/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/ruby/backward -I/Users/me/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1 -I. -I/Users/me/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/me/.rvm/rubies/ruby-1.9.3-p125/lib -L/Users/me/.rvm/usr/lib -L. -L/usr/local/lib -lruby.1.9.1 -lpthread -ldl -lobjc " checked program was: /* begin / 1: #include "ruby.h" 2: 3: int main() {return 0;} / end */