Undefined method `accept' for nil:NilClass

I’ve upgraded to rails 3.2.
I’m using jruby-1.6.5.
When I run db:migrate rake abort with message “undefined method
`accept’ for nil:NilClass”.
I had not that problem with jruby-1.6.5 and rails 3.1.
I’ve submited the bug to jira.

On 20 January 2012 21:11, Mauro [email protected] wrote:

I’ve upgraded to rails 3.2.
I’m using jruby-1.6.5.
When I run db:migrate rake abort with message “undefined method
`accept’ for nil:NilClass”.
I had not that problem with jruby-1.6.5 and rails 3.1.
I’ve submited the bug to jira.

Someone have the same problem?

On 21 January 2012 10:01, Mauro [email protected] wrote:

On 20 January 2012 21:11, Mauro [email protected] wrote:

I’ve upgraded to rails 3.2.
I’m using jruby-1.6.5.
When I run db:migrate rake abort with message “undefined method
`accept’ for nil:NilClass”.
I had not that problem with jruby-1.6.5 and rails 3.1.
I’ve submited the bug to jira.

Someone have the same problem?

It seems so strange to me that none has reported to have the same
problem after upgrade to rails 3.2.

I am getting the same error, and I am using a SQLite database.

that’s the trace:

activerecord (3.2.0)
lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
to_sql' activerecord (3.2.0) lib/active_record/connection_adapters/abstract/query_cache.rb:60:inselect_all’
activerecord (3.2.0) lib/active_record/querying.rb:38:in find_by_sql' activerecord (3.2.0) lib/active_record/explain.rb:38:inlogging_query_plan’
activerecord (3.2.0) lib/active_record/querying.rb:37:in find_by_sql' activerecord (3.2.0) lib/active_record/relation.rb:170:inexec_queries’
activerecord (3.2.0) lib/active_record/relation.rb:159:in to_a' activerecord (3.2.0) lib/active_record/explain.rb:31:inlogging_query_plan’
activerecord (3.2.0) lib/active_record/relation.rb:158:in to_a' activerecord (3.2.0) lib/active_record/relation/finder_methods.rb:159:inall’
org/jruby/RubyBasicObject.java:1688:in __send__' activerecord (3.2.0) lib/active_record/querying.rb:5:inall’
app/controllers/companies_controller.rb:14:in index' org/jruby/RubyBasicObject.java:1688:insend
org/jruby/RubyKernel.java:2114:in send' actionpack (3.2.0) lib/action_controller/metal/implicit_render.rb:4:insend_action’
actionpack (3.2.0) lib/abstract_controller/base.rb:167:in
process_action' actionpack (3.2.0) lib/action_controller/metal/rendering.rb:10:inprocess_action’
actionpack (3.2.0) lib/abstract_controller/callbacks.rb:18:in
process_action' activesupport (3.2.0) lib/active_support/callbacks.rb:439:in_run__796208665__process_action__1096936011__callbacks’
org/jruby/RubyBasicObject.java:1688:in __send__' org/jruby/RubyKernel.java:2114:insend’
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in
__run_callback' activesupport (3.2.0) lib/active_support/callbacks.rb:390:in_run_process_action_callbacks’
org/jruby/RubyBasicObject.java:1694:in __send__' org/jruby/RubyKernel.java:2118:insend’
activesupport (3.2.0) lib/active_support/callbacks.rb:81:in
run_callbacks' actionpack (3.2.0) lib/abstract_controller/callbacks.rb:17:inprocess_action’
actionpack (3.2.0) lib/action_controller/metal/rescue.rb:29:in
process_action' actionpack (3.2.0) lib/action_controller/metal/instrumentation.rb:30:inprocess_action’
activesupport (3.2.0) lib/active_support/notifications.rb:123:in
instrument' activesupport (3.2.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument’
activesupport (3.2.0) lib/active_support/notifications.rb:123:in
instrument' actionpack (3.2.0) lib/action_controller/metal/instrumentation.rb:29:inprocess_action’
actionpack (3.2.0)
lib/action_controller/metal/params_wrapper.rb:205:in process_action' activerecord (3.2.0) lib/active_record/railties/controller_runtime.rb:18:inprocess_action’
actionpack (3.2.0) lib/abstract_controller/base.rb:121:in process' actionpack (3.2.0) lib/abstract_controller/rendering.rb:45:inprocess’
actionpack (3.2.0) lib/action_controller/metal.rb:203:in dispatch' actionpack (3.2.0) lib/action_controller/metal/rack_delegation.rb:14:indispatch’
actionpack (3.2.0) lib/action_controller/metal.rb:246:in action' org/jruby/RubyProc.java:258:incall’
actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:66:in
dispatch' actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:30:incall’
journey (1.0.0) lib/journey/router.rb:60:in call' org/jruby/RubyArray.java:1612:ineach’
journey (1.0.0) lib/journey/router.rb:48:in call' actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:570:incall’
sass (3.1.12) lib/sass/plugin/rack.rb:54:in call' warden (1.1.0) lib/warden/manager.rb:35:incall’
org/jruby/RubyKernel.java:1206:in catch' warden (1.1.0) lib/warden/manager.rb:34:incall’
actionpack (3.2.0)
lib/action_dispatch/middleware/best_standards_support.rb:17:in call' rack (1.4.0) lib/rack/etag.rb:23:incall’
rack (1.4.0) lib/rack/conditionalget.rb:25:in call' actionpack (3.2.0) lib/action_dispatch/middleware/head.rb:14:incall’
remotipart (1.0.1) lib/remotipart/middleware.rb:30:in call' actionpack (3.2.0) lib/action_dispatch/middleware/params_parser.rb:21:incall’
actionpack (3.2.0) lib/action_dispatch/middleware/flash.rb:242:in call' rack (1.4.0) lib/rack/session/abstract/id.rb:205:incontext’
rack (1.4.0) lib/rack/session/abstract/id.rb:200:in call' actionpack (3.2.0) lib/action_dispatch/middleware/cookies.rb:338:incall’
activerecord (3.2.0) lib/active_record/query_cache.rb:64:in call' activerecord (3.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:incall’
actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:28:in
call' activesupport (3.2.0) lib/active_support/callbacks.rb:408:in_run__453674643__call__1045394743__callbacks’
org/jruby/RubyBasicObject.java:1688:in __send__' org/jruby/RubyKernel.java:2114:insend’
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in
__run_callback' activesupport (3.2.0) lib/active_support/callbacks.rb:390:in_run_call_callbacks’
org/jruby/RubyBasicObject.java:1688:in __send__' org/jruby/RubyKernel.java:2114:insend’
activesupport (3.2.0) lib/active_support/callbacks.rb:81:in
run_callbacks' actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:27:incall’
actionpack (3.2.0) lib/action_dispatch/middleware/reloader.rb:65:in
call' actionpack (3.2.0) lib/action_dispatch/middleware/remote_ip.rb:31:incall’
actionpack (3.2.0)
lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' actionpack (3.2.0) lib/action_dispatch/middleware/show_exceptions.rb:56:incall’
railties (3.2.0) lib/rails/rack/logger.rb:26:in call_app' railties (3.2.0) lib/rails/rack/logger.rb:16:incall’
actionpack (3.2.0) lib/action_dispatch/middleware/request_id.rb:22:in
call' rack (1.4.0) lib/rack/methodoverride.rb:21:incall’
rack (1.4.0) lib/rack/runtime.rb:17:in call' activesupport (3.2.0) lib/active_support/cache/strategy/local_cache.rb:72:incall’
rack (1.4.0) lib/rack/lock.rb:15:in call' actionpack (3.2.0) lib/action_dispatch/middleware/static.rb:53:incall’
railties (3.2.0) lib/rails/engine.rb:479:in call' railties (3.2.0) lib/rails/application.rb:220:incall’
rack (1.4.0) lib/rack/content_length.rb:14:in call' railties (3.2.0) lib/rails/rack/log_tailer.rb:14:incall’
rack (1.4.0) lib/rack/handler/webrick.rb:59:in service' /home/mauro/jruby/lib/ruby/1.9/webrick/httpserver.rb:111:inservice’
/home/mauro/jruby/lib/ruby/1.9/webrick/httpserver.rb:70:in run' /home/mauro/jruby/lib/ruby/1.9/webrick/server.rb:183:instart_thread’

I get the same error, and using mysql adapter – development environment
on OSX (haven’t tested on production yet)

activerecord (3.2.0)
lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
to_sql' activerecord (3.2.0) lib/active_record/connection_adapters/abstract/query_cache.rb:60:inselect_all’
activerecord (3.2.0) lib/active_record/querying.rb:38:in block in find_by_sql' activerecord (3.2.0) lib/active_record/explain.rb:38:inlogging_query_plan’
activerecord (3.2.0) lib/active_record/querying.rb:37:in find_by_sql' activerecord (3.2.0) lib/active_record/relation.rb:170:inexec_queries’
activerecord (3.2.0) lib/active_record/relation.rb:159:in `block in
to_a’

I’m getting the error on Ubuntu when running an Oracle query. MRI Ruby
1.9.3-p0

Opened an issue in the rails github

Hi.

We have a JIRA ticket now: https://jira.codehaus.org/browse/JRUBY-6363

This is most likely a JRuby issue (and much less likely JDBC
adapter/Rails issue).

I was able to FIX the issue by getting the latest mysql2 gem. In my gem
file, I has a specific older vesion and removing the version and
updating the bundle resolved the issue.

Here’s the closing comment from GitHub:

Same case using ruby-oci8(v2.1.0) along with oracle_enhanced(v1.4.0)
adapters. It worked with Rails 3.1. Neither console nor rake work. I
guess the problem is from oracle_enhanced adapter because the ruby-oci8
worked (OCI8.new …).

On 23 January 2012 23:37, Shyam H. [email protected] wrote:

I was able to FIX the issue by getting the latest mysql2 gem. In my gem
file, I has a specific older vesion and removing the version and
updating the bundle resolved the issue.

I’m using postgres and I’ve still the issue.

David W. wrote in post #1042688:

Same case using ruby-oci8(v2.1.0) along with oracle_enhanced(v1.4.0)
adapters. It worked with Rails 3.1. Neither console nor rake work. I
guess the problem is from oracle_enhanced adapter because the ruby-oci8
worked (OCI8.new …).

I have to uninstall rails v3.2 and install rails 3.1 to make my app
work. Thanks!

After upgrading activerecord-oracle_enhanced-adapter to 1.4.1, it is now
working for me against both MySQL and Oracle from Rails 3.2.1 and MRI
Ruby 1.9.3-p0.

Thank you Raimonds Simanovskis & Edgars Beigarts!

On 26 January 2012 19:15, David W. [email protected] wrote:

David W. wrote in post #1042688:

Same case using ruby-oci8(v2.1.0) along with oracle_enhanced(v1.4.0)
adapters. It worked with Rails 3.1. Neither console nor rake work. I
guess the problem is from oracle_enhanced adapter because the ruby-oci8
worked (OCI8.new …).

I have to uninstall rails v3.2 and install rails 3.1 to make my app
work. Thanks!

I’ve done the same, but I hope the bug is resolved soon.

Hi,

On 27/01/2012 07:32, Mauro wrote:

I’ve done the same, but I hope the bug is resolved soon.

As a follow-up to this in case someone comes across this thread (as I
did), this was a AR-JDBC issue that’s now fixed.

$ bundle update activerecord-jdbc-adapter

fixes the problem for me.

Regards,
Sébastien.