ruby on rails - Trouble with mysql gem on osx 10.6.8 -


i'm updating database sqlite mysql (@mu short...i know. know. should have done @ beginning) , running problem.

here's process far:

step 1:

update database.yml , run rake db:schema:load per this

rake aborted! please install mysql adapter: `gem install activerecord-mysql-adapter` (mysql not part of bundle. add gemfile.) 

step 2:

run rvm @global gem install mysql

fetching: mysql-2.9.1.gem (100%) building native extensions.  take while... error:  error installing mysql:     error: failed build gem native extension.      /users/charliekim/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking mysql_query() in -lmysqlclient... no checking main() in -lm... yes checking mysql_query() in -lmysqlclient... no checking main() in -lz... yes checking mysql_query() in -lmysqlclient... no checking main() in -lsocket... no checking mysql_query() in -lmysqlclient... no checking main() in -lnsl... no checking mysql_query() in -lmysqlclient... no checking main() in -lmygcc... no checking mysql_query() in -lmysqlclient... no *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers.  check mkmf.log file more details.  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/charliekim/.rvm/rubies/ruby-2.0.0-p247/bin/ruby     --with-mysql-config     --without-mysql-config     --with-mysql-dir     --without-mysql-dir     --with-mysql-include     --without-mysql-include=${mysql-dir}/include     --with-mysql-lib     --without-mysql-lib=${mysql-dir}/     --with-mysqlclientlib     --without-mysqlclientlib     --with-mlib     --without-mlib     --with-mysqlclientlib     --without-mysqlclientlib     --with-zlib     --without-zlib     --with-mysqlclientlib     --without-mysqlclientlib     --with-socketlib     --without-socketlib     --with-mysqlclientlib     --without-mysqlclientlib     --with-nsllib     --without-nsllib     --with-mysqlclientlib     --without-mysqlclientlib     --with-mygcclib     --without-mygcclib     --with-mysqlclientlib     --without-mysqlclientlib   gem files remain installed in /users/charliekim/.rvm/gems/ruby-2.0.0-p247@global/gems/mysql-2.9.1 inspection. results logged /users/charliekim/.rvm/gems/ruby-2.0.0-p247@global/gems/mysql-2.9.1/ext/mysql_api/gem_make.out 

step 3:

search => can't install mysql gem on mac os x

the solution in answer didn't work there no mysql directory in /usr/local can't edit code there.

step 4:

output of mkmf.log => http://pastebin.com/7qsdv73r
output of gcc -v =>

using built-in specs. target: i686-apple-darwin10 configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 thread model: posix gcc version 4.2.1 (apple inc. build 5666) (dot 3) 

edit 1:

i ran: gem install activerecord-mysql-adapter

which returned:

fetching: mysql-2.9.1.gem (100%) building native extensions.  take while... installed mysql-2.9.1 fetching: i18n-0.6.5.gem (100%) installed i18n-0.6.5 fetching: atomic-1.1.13.gem (100%) building native extensions.  take while... installed atomic-1.1.13 fetching: thread_safe-0.1.2.gem (100%) installed thread_safe-0.1.2 fetching: activesupport-4.0.0.gem (100%) installed activesupport-4.0.0 fetching: activerecord-mysql-adapter-0.0.1.gem (100%) installed activerecord-mysql-adapter-0.0.1 fetching: builder-3.1.4.gem (100%) installed builder-3.1.4 fetching: activemodel-4.0.0.gem (100%) installed activemodel-4.0.0 fetching: arel-4.0.0.gem (100%) installed arel-4.0.0 fetching: activerecord-deprecated_finders-1.0.3.gem (100%) installed activerecord-deprecated_finders-1.0.3 parsing documentation mysql-2.9.1 unable convert "\xcf" ascii-8bit utf-8 lib/mysql/mysql_api.bundle, skipping installing ri documentation mysql-2.9.1 parsing documentation i18n-0.6.5 installing ri documentation i18n-0.6.5 parsing documentation atomic-1.1.13 unable convert "\xcf" ascii-8bit utf-8 lib/atomic_reference.bundle, skipping installing ri documentation atomic-1.1.13 parsing documentation thread_safe-0.1.2 installing ri documentation thread_safe-0.1.2 parsing documentation activesupport-4.0.0 unable convert "\x80" ascii-8bit utf-8 lib/active_support/values/unicode_tables.dat, skipping installing ri documentation activesupport-4.0.0 parsing documentation activerecord-mysql-adapter-0.0.1 installing ri documentation activerecord-mysql-adapter-0.0.1 parsing documentation builder-3.1.4 /users/charliekim/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: unsupported encoding : ignored /users/charliekim/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: unsupported encoding  ignored installing ri documentation builder-3.1.4 parsing documentation activemodel-4.0.0 installing ri documentation activemodel-4.0.0 parsing documentation arel-4.0.0 installing ri documentation arel-4.0.0 parsing documentation activerecord-deprecated_finders-1.0.3 installing ri documentation activerecord-deprecated_finders-1.0.3 10 gems installed 

but still same error when running rake db:schema:load:

rake aborted! please install mysql adapter: `gem install activerecord-mysql-adapter` (mysql not part of bundle. add gemfile.) ... 

edit 2:

here database.yml:

development:   adapter: mysql   encoding: utf8   reconnect: false   database: db/development   pool: 5   username: [name]   password: [password]   socket: /tmp/mysql.sock test:   adapter: mysql   encoding: utf8   reconnect: false   database: db/test   pool: 5   username: [name]   password: [password]   socket: /tmp/mysql.sock  production:   adapter: mysql   encoding: utf8   reconnect: false   database: db/production   pool: 5   username: [name]   password: [password]   socket: /tmp/mysql.sock 

i added gem "mysql" gemfile , getting error

rake aborted! can't connect local mysql server through socket '/tmp/mysql.sock' (2) 

i don't know sockets should be, filled them in based on post, part of problem.

moving comment answer.

1.) answer please install mysql adapter: gem install activerecord-mysql-adapte (mysql not part of bundle. add gemfile.)

ans: in database.yml file, adapter should mysql2 not mysql

2.) rake aborted! can't connect local mysql server through socket /tmp/mysql.sock (2)

ans: find exact socket file using command

mysqladmin variables | grep socket 

if have password root, do

mysqladmin -pxxxx variables | grep socket 

you wil socket file using above command , replace in database.yml file

cheers.!!