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

MySQL: undefined method `accept' for nil:NilClass #7295

Closed
nstuart opened this Issue Aug 9, 2012 · 10 comments

Comments

Projects
None yet
5 participants
@nstuart
Copy link

nstuart commented Aug 9, 2012

This feels like the same issue as reported in #4632 (I could not reopen, said I did not have permission)

Full details of rails env can be found here: https://gist.github.com/3299864

Other info:

ruby info:
ruby 1.8.7 (2011-12-28 patchlevel 357) [i686-darwin11.2.0]

mysql:
mysql Ver 14.14 Distrib 5.5.27, for osx10.6 (i386) using readline 5.1

stack trace:
rake aborted!
undefined method accept' for nil:NilClass /Users/nick/.rvm/gems/ruby-1.8.7-p357@slr/gems/activerecord-3.2.7/lib/active_record/connection_adapters/abstract/database_statements.rb:7:into_sql'
/Users/nick/.rvm/gems/ruby-1.8.7-p357@slr/gems/activerecord-3.2.7/lib/active_record/connection_adapters/abstract/database_statements.rb:38:in select_values' /Users/nick/.rvm/gems/ruby-1.8.7-p357@slr/gems/activerecord-3.2.7/lib/active_record/migration.rb:587:inget_all_versions'
/Users/nick/.rvm/gems/ruby-1.8.7-p357@slr/gems/activerecord-3.2.7/lib/active_record/migration.rb:745:in migrated' /Users/nick/.rvm/gems/ruby-1.8.7-p357@slr/gems/activerecord-3.2.7/lib/active_record/migration.rb:668:incurrent_version'
/Users/nick/.rvm/gems/ruby-1.8.7-p357@slr/gems/activerecord-3.2.7/lib/active_record/migration.rb:685:in migrate' /Users/nick/.rvm/gems/ruby-1.8.7-p357@slr/gems/activesupport-3.2.7/lib/active_support/callbacks.rb:400:indetect

@tenderlove

This comment has been minimized.

Copy link
Member

tenderlove commented Aug 9, 2012

Thanks for the report! Would it be possible to post an application that reproduces the problem? If not, can it be done privately?

@nstuart

This comment has been minimized.

Copy link

nstuart commented Aug 9, 2012

Here ya go, it's pretty empty:
https://github.com/nstuart/rails-example-error

But this reproduces it cleanly and every time. As noted in the gist, db:create and db:drop do work, just not the migrations.

@nstuart

This comment has been minimized.

Copy link

nstuart commented Aug 9, 2012

Oh, and only other detail is this is on OS X 10.7.4

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Aug 9, 2012

@nstuart try to remove the activerecord-mysql2-adapter from your gemfile.

@Aaronneyer

This comment has been minimized.

Copy link

Aaronneyer commented Aug 9, 2012

I'm having the same problem, asked about it here: http://stackoverflow.com/questions/11889679/undefined-method-accept-for-nilnilclass-after-upgrading-to-rails-3
@rafaelfranca For me, removing the activerecord-mysql2-adapter replaced the "undefined method accept' for nil:NilClass" with undefined methodgenerated_methods?' for #Class:0x7f10733eb2e8

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Aug 9, 2012

Is this gem in your Gemfile? markos_validates_timeliness

@tenderlove

This comment has been minimized.

Copy link
Member

tenderlove commented Aug 9, 2012

@nstuart yes, as @rafaelfranca says, you need to remove activerecord-mysql2-adapter from your Gemfile. The mysql2 adapter ships with Rails 3.1 and up, so you don't need this gem (in fact, that gem is causing your error).

@Aaronneyer can you create a sample application and open a new ticket? It sounds like you have a different issue than this issue. Thanks!

@tenderlove tenderlove closed this Aug 9, 2012

@nstuart

This comment has been minimized.

Copy link

nstuart commented Aug 9, 2012

Ug, thanks, that did the trick. Sorry for the noise.

@tenderlove

This comment has been minimized.

Copy link
Member

tenderlove commented Aug 9, 2012

@nstuart don't worry about it! :-)

@lfxgroove

This comment has been minimized.

Copy link

lfxgroove commented Jan 28, 2013

@tenderlove Just wanted to say thanks, ran into the exact same problem and removing the activerecord-mysql2-adapter solved it for me aswell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment