Forum: Ruby-Forum.com Need help with rake db:migrate and mysql on Mac OS X Darwin

7da3d795630c59f6f02497cf1a316c0d?d=identicon&s=25 Robert Todd (rptodd)
on 2009-01-18 23:31
When I run the command, with the --trace option I get the following
stacktrace

rake --trace db:migrate
(in /Users/roberttodd/ruby/photos)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please
install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in
`require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in
`require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/reporting.rb:11:in
`silence_warnings'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:63:in
`mysql_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in
`synchronize'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:121:in
`retrieve_connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:113:in
`connection'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:429:in
`initialize'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:394:in
`new'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:394:in
`up'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:377:in
`migrate'
/Library/Ruby/Gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:111
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:617:in
`call'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:617:in
`execute'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:612:in
`each'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:612:in
`execute'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
`invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in
`synchronize'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
`invoke_with_call_chain'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:564:in
`invoke'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in
`invoke_task'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`top_level'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`each'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`top_level'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in
`top_level'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in
`run'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in
`run'
/Users/roberttodd/.gem/ruby/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

when I run sudo gem install mysql I get

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
  ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb install mysql
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
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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}/lib
  --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


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7
for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out

the log file says


"gcc -o conftest -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -I/usr/local/include  -arch ppc -arch i386 -Os -pipe -fno-common
conftest.c  -L"."
-L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib"
-L"/usr/local/lib" -L"/usr/local/lib/mysql" -L. -arch ppc -arch i386
-lz -lm  -lruby -lmysqlclient -lz -lm  -lpthread -ldl -lm  "
ld: library not found for -lmysqlclient
collect2: ld returned 1 exit status
ld: library not found for -lmysqlclient
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccKGcV93.out (No such file or
directory)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { mysql_query(); return 0; }
/* end */


All of which seems to point to not finding lmysqlclient.  So the
question is how to I cure this problem and get rake to beuild my table?














the mk
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.