rails: Error "undefined method `accept' for nil:NilClass" after upgrading to rails 3.2
Getting the error undefined method
accept’ for nil:NilClass` in my controller. This is on the development environment running on OSX with mysql. Below is the full stack trace and also my bundle/gem setup information.
$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
RAILS FRAMEWORK 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:in `select_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:in `logging_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:in `exec_queries'
activerecord (3.2.0) lib/active_record/relation.rb:159:in `block in to_a'
activerecord (3.2.0) lib/active_record/explain.rb:31:in `logging_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:377:in `find_first'
activerecord (3.2.0) lib/active_record/relation/finder_methods.rb:122:in `first'
activerecord (3.2.0) lib/active_record/querying.rb:5:in `first'
actionpack (3.2.0) lib/action_controller/metal.rb:246:in `new'
actionpack (3.2.0) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:66:in `call'
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:in `call'
journey (1.0.0) lib/journey/router.rb:60:in `block in call'
journey (1.0.0) lib/journey/router.rb:48:in `each'
journey (1.0.0) lib/journey/router.rb:48:in `call'
actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:570:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/cookies.rb:338:in `call'
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:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in `_run__359795530058627940__call__1911828153620681267__callbacks'
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.0) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
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:in `call'
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:in `call'
railties (3.2.0) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.0) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.0) lib/rails/engine.rb:479:in `call'
railties (3.2.0) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.0) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Gemfile
source 'http://rubygems.org'
gem 'rails', '3.2.0'
gem 'mysql2', '0.2.6'
# Gems used only for assets and not required in production by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
# Deploy with Capistrano
# gem 'capistrano'
gem 'rabl'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :development, :test do
gem 'annotate'
gem 'simplecov'
end
BUNDLE show
$ bundle show
Gems included by the bundle:
* actionmailer (3.2.0)
* actionpack (3.2.0)
* activemodel (3.2.0)
* activerecord (3.2.0)
* activeresource (3.2.0)
* activesupport (3.2.0)
* annotate (2.4.0)
* arel (3.0.0)
* builder (3.0.0)
* bundler (1.0.21)
* coffee-rails (3.2.1)
* coffee-script (2.2.0)
* coffee-script-source (1.2.0)
* erubis (2.7.0)
* execjs (1.3.0)
* hike (1.2.1)
* i18n (0.6.0)
* journey (1.0.0)
* json (1.6.5)
* mail (2.4.1)
* mime-types (1.17.2)
* multi_json (1.0.4)
* mysql2 (0.2.6)
* polyglot (0.3.3)
* rabl (0.5.3)
* rack (1.4.1)
* rack-cache (1.1)
* rack-ssl (1.3.2)
* rack-test (0.6.1)
* rails (3.2.0)
* railties (3.2.0)
* rake (0.9.2.2)
* rdoc (3.12)
* sass (3.1.12)
* sass-rails (3.2.3)
* simplecov (0.5.4)
* simplecov-html (0.5.3)
* sprockets (2.1.2)
* thor (0.14.6)
* tilt (1.3.3)
* treetop (1.4.10)
* tzinfo (0.3.31)
* uglifier (1.2.2)
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 29 (6 by maintainers)
remove that from my gemfile!!
gem ‘activerecord-mysql2-adapter’