Reputation: 5832
Can someone help me out? Setting up a local Rails 2.2.2 project but rake is failing. The mysql gem was installed:
Installed MySQL gem like so:
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Successfully installed mysql-2.9.0
1 gem installed
Installing ri documentation for mysql-2.9.0...
Installing RDoc documentation for mysql-2.9.0...
Then tried to call rake:
$ rake --trace db:migrate
** 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!
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.9.0/lib/mysql/mysql_api.bundle, 9): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.9.0/lib/mysql/mysql_api.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql-2.9.0/lib/mysql/mysql_api.bundle
Upvotes: 1
Views: 1148
Reputation: 5832
Adding the mysql lib path to .bash_profile
and .profile
fixed it:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
Upvotes: 5
Reputation: 1
Issue - !!! 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/mysql_api
Steps to Resolution -
1) gem install mysql -- --with-mysql-dir= Path_to_MySQL_root_folder
2) Running this command will show a link for download like this- http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick
3) Copy lib/libmysql from this download folder to C:/Ruby/bin
Upvotes: 0
Reputation: 106
On Mavericks with rvm ruby1.8.7 and rails 2.3 I had to install mysql gem with
gem install mysql -- --with-mysql-dir=/usr/local/mysql
and then I needed export from Slinky's answer added to my .zshenv
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
Upvotes: 1