mysql adapter in database.yml

Added by Valentin Bud almost 6 years ago

Hello Community,

I am new around here, new around Ruby also for that matter. Today I have installed for the first time Redmine.
I have had some troubles. It might be a bug, or it might as well not.

My environment is consisted of FreeBSD with RVM, ruby 1.9.3, and a dedicated user redmine for installation. I have followed RedmineInstall and everything went smooth until I had to run

> RAILS_ENV=production rake db:migrate

The above thrown the following error:

rake aborted!
Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

As you might already know there is no activerecord-mysql-adapter gem available around. Digging around the Internet I have found a post on stackoverflow talking about this. The solution they gave was to change adapter: from database.yml from mysql to mysql2. Doing that resolved my problem.

Why do I think it's a bug or just a typo in the config file? In Gemfile configuration for bundle is clearly specified that for ruby mri_19 (which is my case) mysql2 gem should be installed. I think it would be better to change, or at least specify in database.yml that for ruby mri_1.9 you should use mysql2 for adapter:.

Thinking again this might not be possible, because, as I've seen so far, there are quite a few ruby variations out there, jruby, mri, macruby, etc., each of which uses different database connectors.

Although I do think that a comment in the database.yml config file could help newcomers.

Cheers and Goodwill, |e

Replies (1)

RE: mysql adapter in database.yml - Added by Valentin Bud almost 6 years ago

Hello again,

Yes it is there on RedmineInstall

Example for a MySQL database using ruby1.9 (adapter must be set to mysql2):

Can somebody delete the post? Sorry for the noise.

Cheers and Goodwill, |e