0

It always says:

ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.

        /Users/peter/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... *** 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.

similar things happen if it is sqlite3:

ERROR:  Error installing sqlite3:
    ERROR: Failed to build gem native extension.

        /Users/peter/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for sqlite3.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.

Update: at least sqlite3 is building now... that is after I rvm remove 1.9.2-p180 and removing all the 1.9.2, and reinstall by rvm install 1.9.2 and now sqlite3 can be bundle installed, but mysql2 still has problem.

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
  • sigh... somehow I feel like I am building things as if I am doing programming with a couple of friends who are experimenting with things and always breaking things in high school, or in a computer class where the Professor is busy publishing papers, and the TA is busy with their classes and smoking, and the lab project is a mess – nonopolarity Apr 03 '11 at 14:01
  • Please show content of mkmf.log saved in gem's directory. – taro Apr 03 '11 at 14:20
  • i installed the 64-bit version of MySQL and now I can bundle install, but when I `rails g scaffold foo name:string`, then it will say: `/Users/peter/.rvm/gems/ruby-1.9.2-p180@rails305/gems/mysql2-0.2.7/lib/mysql2.rb:8:in 'require': dlopen(/Users/peter/.rvm/gems/ruby-1.9.2-p180@rails305/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)` – nonopolarity Apr 03 '11 at 15:13
  • seems like the above can be fixed by http://stackoverflow.com/questions/4546698/library-not-loaded-libmysqlclient-16-dylib-error-when-trying-to-run-rails-serve but there is talk about using sudo or no sudo... i use rvm but used sudo already with that line... hope that didn't affect anything... i didn't even know what `install_name_tool` is... – nonopolarity Apr 03 '11 at 15:24

1 Answers1

0

I installed the 64 bit version of MySQL server and it will bundle install, and then this question helped with the

Library not loaded: libmysqlclient.18.dylib (LoadError)

solution: Library not loaded: libmysqlclient.16.dylib error when trying to run 'rails server' on OS X 10.6 with mysql2 gem

Community
  • 1
  • 1
nonopolarity
  • 146,324
  • 131
  • 460
  • 740