ZeroModulus
2012-Aug-14 02:22 UTC
NoMethodError: undefined method `accept'' for nil:NilClass
Here''s the trace, NoMethodError: undefined method `accept'' for nil:NilClass from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `to_sql'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:89:in `insert'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `insert'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/relation.rb:66:in `insert'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/persistence.rb:363:in `create'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/timestamp.rb:57:in `create'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/callbacks.rb:268:in `block in create'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:403:in `_run__3940325652772678349__create__4360101769414794529__callbacks'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/callbacks.rb:268:in `create'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/persistence.rb:344:in `create_or_update'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/callbacks.rb:264:in `block in create_or_update'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:403:in `_run__3940325652772678349__save__4360101769414794529__callbacks'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'' ... 4 levels... from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/validations.rb:50:in `save'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/attribute_methods/dirty.rb:22:in `save'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:241:in `block (2 levels) in save'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:208:in `transaction'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:241:in `block in save'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:240:in `save'' from (irb):7 from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands/console.rb:47:in `start'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands/console.rb:8:in `start'' from /Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands.rb:41:in `<top (required)>'' from script/rails:6:in `require'' from script/rails:6:in `<main>''ruby-1.9.2-p290 :008 > ^D From other sources on the web I found I should run the following, $ bundle update activerecord-mysql2-adapter mysql2 I had the latest versions of these gems already, but I get the same error. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/sMfRZLkoLO8J. For more options, visit https://groups.google.com/groups/opt_out.
ZeroModulus
2012-Aug-14 02:34 UTC
Re: NoMethodError: undefined method `accept'' for nil:NilClass
I fixed the problem by removing activerecord-mysql2-adapter from my Gemfile and using only mysql2. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/1oHa1Qs1SAcJ. For more options, visit https://groups.google.com/groups/opt_out.
Apparently Analagous Threads
- /usr/bin/ld: cannot find -lmysqlclient_r installing ruby gem mysql2.... in Fedora Linux + MySQL 5.5.15...
- NoMethodError: undefined method `expect'
- Where is my gem file located so that i can rake test
- rake db:migrate aborted
- Problem while creating new resource on ActiveAdmin