raise_in_transactional_callbacks 回形针问题 (rails 4.2)

raise_in_transactional_callbacks issue with paperclip (rails 4.2)

我已经更新到 rails 4.2。当我跟进弃用警告并在我的环境中设置 config.active_record.raise_in_transactional_callbacks = true 时,我开始 运行 问题:

     Failure/Error: Unable to find matching line from backtrace
     NoMethodError:
     undefined method `id' for nil:NilClass

ID 指的是 current_user.id,它已变得不可用(因此在错误跟踪中提及 warden 和 devise)。

删除 config.active_record.raise_in_transactional_callbacks = true 时,弃用警告仅针对使用回形针的两个模型出现,这让我相信这可能是回形针回调的问题。我可以忽略弃用警告,但我宁愿解决潜在的问题。有什么建议吗?

这是一个错误跟踪:

commpleted 500 Internal Server Error in 152ms
Unexpected error while processing request: undefined method `env' for nil:NilClass
 /Users/j/.rvm/gems/ruby-2.1.2/gems/devise-3.4.1/lib/devise/controllers/helpers.rb:135:in `warden'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/devise-3.4.1/lib/devise/controllers/helpers.rb:120:in `current_user'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/abstract_controller/helpers.rb:67:in `current_user'
 /Users/j/Google Drive/rails_projects/versneller/app/views/sync/messages/_message.html.erb:48:in `_app_views_sync_messages__message_html_erb___1152654597097292680_70140856995020'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/template.rb:145:in `block in render'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/notifications.rb:166:in `instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/template.rb:333:in `instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/template.rb:143:in `render'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/renderer/partial_renderer.rb:339:in `render_partial'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/renderer/partial_renderer.rb:310:in `block in render'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/renderer/partial_renderer.rb:309:in `render'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/renderer/renderer.rb:47:in `render_partial'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/renderer/renderer.rb:21:in `render'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/helpers/rendering_helper.rb:32:in `render'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/renderer.rb:16:in `render_to_string'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/partial.rb:29:in `render_to_string'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/partial_creator.rb:30:in `message'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/actions.rb:87:in `block (2 levels) in sync_new'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/actions.rb:86:in `collect'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/actions.rb:86:in `block in sync_new'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/actions.rb:80:in `collect'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/actions.rb:80:in `sync_new'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/action.rb:17:in `perform'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/model_actions.rb:48:in `each'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/model_actions.rb:48:in `publish_sync_actions'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:427:in `block in make_lambda'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:250:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:250:in `block in conditional'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:245:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:245:in `block in conditional'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_commit_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/transactions.rb:314:in `committed!'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:93:in `commit_records'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:157:in `commit'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:179:in `commit_transaction'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:198:in `within_new_transaction'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/transactions.rb:220:in `transaction'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/transactions.rb:344:in `with_transaction_returning_status'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/transactions.rb:286:in `block in save'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/transactions.rb:285:in `save'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/persistence.rb:34:in `create'
 /Users/j/Google Drive/rails_projects/versneller/app/controllers/instances_controller.rb:74:in `advice'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:198:in `process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal/rendering.rb:10:in `process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:288:in `block (2 levels) in halting_and_conditional'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/controller_helpers.rb:22:in `block in enable_sync'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/model.rb:24:in `enable'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/sync-0.3.5/lib/sync/controller_helpers.rb:21:in `enable_sync'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:427:in `block in make_lambda'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:287:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:287:in `block in halting_and_conditional'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:19:in `process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal/rescue.rb:29:in `process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:137:in `process'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionview-4.2.0/lib/action_view/rendering.rb:30:in `process'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal.rb:195:in `dispatch'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_controller/metal.rb:236:in `block in action'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:42:in `serve'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:43:in `block in serve'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `each'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `serve'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:802:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/bullet-4.14.4/lib/bullet/rack.rb:10:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/etag.rb:24:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/conditionalget.rb:25:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/head.rb:13:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/remotipart-1.2.1/lib/remotipart/middleware.rb:27:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/flash.rb:260:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:225:in `context'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:220:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/cookies.rb:560:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:36:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `_run_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/reloader.rb:73:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/methodoverride.rb:22:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/runtime.rb:18:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/lock.rb:17:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:113:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/content_length.rb:15:in `call'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/thin-1.6.3/lib/thin/connection.rb:86:in `block in pre_process'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/thin-1.6.3/lib/thin/connection.rb:84:in `catch'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/thin-1.6.3/lib/thin/connection.rb:84:in `pre_process'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/thin-1.6.3/lib/thin/connection.rb:53:in `process'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/thin-1.6.3/lib/thin/connection.rb:39:in `receive_data'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run_machine'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/thin-1.6.3/lib/thin/server.rb:162:in `start'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/handler/thin.rb:19:in `run'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/rack-1.6.0/lib/rack/server.rb:286:in `start'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
 /Users/j/.rvm/gems/ruby-2.1.2/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
 bin/railre'

这是与您所说的相关的问题:https://github.com/thoughtbot/paperclip/issues/1933 (especially my comments : https://github.com/thoughtbot/paperclip/issues/1933#issuecomment-169607838 and https://github.com/thoughtbot/paperclip/issues/1933#issuecomment-170509222 )

请注意这个警告不是错误,它只是告诉你 ActiveRecord 的未来行为,这不是浅错误。

删除 config.active_record.raise_in_transactional_callbacks = true 将向您显示 after_commit / after_rollback 的警告并切换到旧行为,这是浅化错误。