I\'m having trouble finding a solution to this problem. I\'m getting the error:
Please install the mysql adapter: \'gem install activerecord-mysql-adapter\'
What helped for me was specifying adapter mysql2 instead of mysql (note the digit!) in config/database.yml.
The problem is on your file config/database.yml
You should have a line that specify that the adapter is mysql2 (and not mysql)
adapter: mysql2
Instead of
adapter: mysql
Step 1. gem 'mysql2', "~>0.3.11"
instead of gem 'mysql2'
in Gemfile
Step 2. putting mysqllib.dll
(available at mysql installation C:\wamp\bin\mysql\mysql5.5.24\lib
) in the C:\ruby2.0.0\bin
folder solved the rake db:migrate
problem and successfully connected my rails with mysql (database.yml
contains mysql2)
I'm running windows 7, 64bit, mysql 64bit, ruby 2.0.0 [x64-mingw32]
Thanks you all for your inputs.
For a old rails 2.3.18 ruby 1.8.7 app that I 'migrated' to a new MacBook (High Sierra - 10.13.6), in order to get the app to run (using POW) and to use script/console, I had to disable SIP and create a link to a file in /urs/lib/ directory. Migration Assistant was unable to create the link because of SIP.
To Disable SIP - System Integrity Protection
Boot into Mac OS Recovery Mode as usual by holding down the Command and R keys during system start.
Choose the language as usual (if applicable)
At the “MacOS Utilities” screen, pull down the “Utilities” menu from the top of the screen.
In terminal, type command: csrutil disable
Restart your computer
Finally, after restarting, in Terminal enter this command:
sudo ln /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
This might be late but bundle install was installing 0.4.0 So I tried to edit the gem file and I replace mysql2
with
gem 'mysql2', "~>0.3.11"
and then
bundle install
in the terminal (This will install mysql2 0.3.11 and not the last version) I think active record have problems working with the last version. Well I hope it helps
If nothing helps (you have mysql2
as adapter in your database.yml
) and you are using RVM to manage your ruby versions, here is the simplest solution:
Try to remove all of your old gemsets (including global
), install a fresh ruby version and bundle again. I could solve the problem that way.