我在销毁对象时遇到了这个问题。
NoMethodError: undefined method `substitute_at' for nil:NilClass
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/persistence.rb:135:in `destroy'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/locking/optimistic.rb:103:in `destroy'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/callbacks.rb:254:in `block in destroy'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:480:in `_run__348799253__destroy__466331341__callbacks'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/callbacks.rb:254:in `destroy'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/transactions.rb:254:in `block in destroy'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/transactions.rb:208:in `transaction'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/activerecord-3.2.11/lib/active_record/transactions.rb:254:in `destroy'
from (irb):1
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194@clu2/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'