Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.0 compatibility #984

Closed
florrain opened this issue Jun 24, 2018 · 3 comments
Closed

Rails 4.0 compatibility #984

florrain opened this issue Jun 24, 2018 · 3 comments

Comments

@florrain
Copy link

Hello,

I'm working with a Rails 4.0 application where I'm seeing this error. I'd like to upgrade the mysql2 client version to the latest as possible (0.4.6 and greater). The application is using a 0.3.x version currently.

I'm seeing two inconsistent versioning recommendations, one in the README and one in the 0.5.0 release notes.

mysql2 0.4.x works with Rails / Active Record 4.2.5 - 5.0 and higher.

For Rails 4.x please pin the gem to mysql2 '~> 0.4.0' to avoid the 0.5.x upgrade.

Could you tell which is the source of truth?

Thanks

@sodabrew
Copy link
Collaborator

sodabrew commented Jul 4, 2018

Both statements are true.

@florrain
Copy link
Author

florrain commented Jul 5, 2018

The second infers that 4.0 and 4.2 can be used with ~> 0.4.0 which goes in conflict with the first that is stricter. I guess I'll go the safe way and try to do the Rails upgrade before mysql2.

@florrain florrain closed this as completed Jul 5, 2018
@jcowhigjr
Copy link

jcowhigjr commented Sep 3, 2019

https://stackoverflow.com/questions/22932282/gemloaderror-for-mysql2-gem-but-its-already-in-gemfile just in case someone is confused that the mysql2 gem can be added to the Gemfile with Rails 4.0, 4.1 etc .. You will see a failure when you boot the application. dbconsole might work but active record will complain: '...ensure its version is at the minimum required by ActiveRecord'

If someone sees this remember:

mysql2 0.4.x works with Rails / Active Record 4.2.5 - 5.0 and higher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants