Reputation: 93
I'm trying to run rake db:migrate in Rails, and every single time I try I get the same error :
[BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.3.0]
I have installed: gcc v4.2.1 ruby 1.9.3p194 rails 3.2.13 The most recent version of XCode (updated last night) homebrew 0.9.1 mysql 5.0.96
I have been searching SO and other sites all afternoon, and I've only found answers to my question for Linux/Debian.
Other things to note: The mysql gem (and mysql2) does not install to my machine. When attempting to install I get a this message:
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/Users/USERNAME/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** 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.
Anyone have any ideas! I'm very new to rails and fairly new to ruby, but this error has been completely hampering my progress. Thanks!
Upvotes: 0
Views: 1149
Reputation: 4255
The errors you're seeing there mean that rubygems can't find the mysql development libraries. Make sure they're installed (using homebrew, macports or fink, whatever you usually use.) If they're installed and you still can't install the mysql gem, check the mkmf.log for details; you may need to do something special to tell it where to find those libraries.
Until you're able to install every gem listed in your Gemfile, you're not going to be able to run any rake command or the rails console.
Upvotes: 1