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

mysql2 gem v0.4.0 doesn't work #21544

Closed
lesleh opened this issue Sep 8, 2015 · 9 comments
Closed

mysql2 gem v0.4.0 doesn't work #21544

lesleh opened this issue Sep 8, 2015 · 9 comments

Comments

@lesleh
Copy link

lesleh commented Sep 8, 2015

When creating a new app with rails new myapp --database=mysql, I get an error when attempting to load the app:

Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Manually specifying the version of mysql2 to be v0.3.20 works fine.

@sodabrew
Copy link
Contributor

sodabrew commented Sep 8, 2015

I didn't realize the AR adapter was using a squiggly require, so this will cause some confusion because Bundler doesn't know that it needs to hold back the mysql2 version.

@jeremy Thanks for updating the adapter - I left you a few comments on #21536

jeremy added a commit that referenced this issue Sep 8, 2015
@rafaelfranca
Copy link
Member

Backported

@rafaelfranca
Copy link
Member

I mean, next Rails 4.2 will support mysql2 0.4

xithan added a commit to xithan/wagn that referenced this issue Sep 8, 2015
latest mysql2 update doesn't work with Rails rails/rails#21544
@jaredbeck
Copy link
Contributor

.. next Rails 4.2 will support mysql2 0.4

Thanks for backporting! ❤️

jaredbeck added a commit to paper-trail-gem/paper_trail that referenced this issue Sep 9, 2015
We would prefer to only constrain mysql2 to '~> 0.3',
but a rails bug (rails/rails#21544)
requires us to constrain to '~> 0.3.20' for now.
xithan added a commit to xithan/wagn that referenced this issue Sep 9, 2015
latest mysql2 update doesn't work with Rails rails/rails#21544
@slicedpan
Copy link

Just a suggestion, this issue would have been easier to diagnose if the exception message from Gem::LoadError was not swallowed up by the exception handler when the adapter specific code is required.

@Sega100500
Copy link

@jaredbeck
For Rails 3.2.xxx need use:
gem 'mysql2', '~> 0.3.20' ?

RoR 3.2.xxx no longer supported
And what about RoR 4.0, RoR 4.1 ?

@kaleemullah360
Copy link

do
gem 'mysql2', '~> 0.3.18' this gem works with rails version 4.x.x
if install gem 'mysql2', '~> 0.4.0' it produces gem load error

tvdeyen pushed a commit to AlchemyCMS/alchemy_cms that referenced this issue Sep 22, 2015
milj pushed a commit to getkiwicom/alchemy_cms that referenced this issue Sep 24, 2015
theunixbeard added a commit to open-source-affiliate/3rd-party-retargeter that referenced this issue Sep 28, 2015
@saizai
Copy link

saizai commented Oct 3, 2015

When will this be released?

ariejan added a commit to ariejan/firefly that referenced this issue Oct 29, 2015
ActiveRecord 4.2.4 does not work with mysql2-0.4.x yet.

rails/rails#21544
ashishkumar added a commit to Go2Study/rails-server that referenced this issue Nov 2, 2015
treffiletti added a commit to treffiletti/LinkShrink that referenced this issue Nov 4, 2015
tvdeyen pushed a commit to AlchemyCMS/alchemy_cms that referenced this issue Nov 19, 2015
jaredbeck added a commit to paper-trail-gem/paper_trail that referenced this issue Dec 21, 2015
We would prefer to only constrain mysql2 to '~> 0.3',
but a rails bug (rails/rails#21544)
requires us to constrain to '~> 0.3.20' for now.
jaredbeck added a commit to paper-trail-gem/paper_trail that referenced this issue Jan 18, 2016
We would prefer to only constrain mysql2 to '~> 0.3',
but a rails bug (rails/rails#21544)
requires us to constrain to '~> 0.3.20' for now.
jaredbeck added a commit to paper-trail-gem/paper_trail that referenced this issue Jan 18, 2016
We would prefer to only constrain mysql2 to '~> 0.3',
but a rails bug (rails/rails#21544)
requires us to constrain to '~> 0.3.20' for now.
newrelicbot pushed a commit to newrelic/newrelic-ruby-agent that referenced this issue Feb 17, 2016
This locks the mysql2 adapter to the same versioning scheme
as listed in the active record source for the deprecated
4.x branches 4.0.x and 4.1.x. This prevents otherwise
incorrect load errors when running the rails40 and rails41
suites. See also: rails/rails#21544
evanrkeller added a commit to evanrkeller/training-benchmarks that referenced this issue Mar 8, 2016
There is an incompatibility with Rails 4.2 and MySQL 0.4.x as per
rails/rails#21544. Updating Rails should fix
this problem but for now this is the simplest fix.
evanrkeller added a commit to evanrkeller/training-benchmarks that referenced this issue Mar 8, 2016
There is an incompatibility with Rails 4.2 and MySQL 0.4.x as per
rails/rails#21544. Updating Rails should fix
this problem but for now this is the simplest fix.
@anle1337
Copy link

anle1337 commented May 7, 2016

Rails v 4.2.4 error with mysql 0.4. has to use mysql2', '~> 0.3.18 to work

mystix added a commit to mystix/magerecord that referenced this issue Dec 7, 2016
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

9 participants