我创建了一个图像上传器并在其中定义了以下版本
version :profile do
process :resize_and_pad [100, 100]
end
当我上传文件时,我收到以下错误消息:
nil is not a symbol
查看完整的堆栈跟踪,它来自 processing.rb
carrierwave (0.6.1) lib/carrierwave/uploader/processing.rb:85:in `block in process!'
carrierwave (0.6.1) lib/carrierwave/uploader/processing.rb:81:in `each'
carrierwave (0.6.1) lib/carrierwave/uploader/processing.rb:81:in `process!'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `block in with_callbacks'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `each'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `with_callbacks'
carrierwave (0.6.1) lib/carrierwave/uploader/cache.rb:112:in `cache!'
carrierwave (0.6.1) lib/carrierwave/uploader/versions.rb:230:in `block in cache_versions!'
carrierwave (0.6.1) lib/carrierwave/uploader/versions.rb:216:in `each'
carrierwave (0.6.1) lib/carrierwave/uploader/versions.rb:216:in `cache_versions!'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `block in with_callbacks'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `each'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `with_callbacks'
carrierwave (0.6.1) lib/carrierwave/uploader/cache.rb:112:in `cache!'
carrierwave (0.6.1) lib/carrierwave/uploader/versions.rb:230:in `block in cache_versions!'
carrierwave (0.6.1) lib/carrierwave/uploader/versions.rb:216:in `each'
carrierwave (0.6.1) lib/carrierwave/uploader/versions.rb:216:in `cache_versions!'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `block in with_callbacks'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `each'
carrierwave (0.6.1) lib/carrierwave/uploader/callbacks.rb:18:in `with_callbacks'
carrierwave (0.6.1) lib/carrierwave/uploader/cache.rb:112:in `cache!'
carrierwave (0.6.1) lib/carrierwave/mount.rb:315:in `cache'
carrierwave (0.6.1) lib/carrierwave/mount.rb:173:in `profile_image='
carrierwave (0.6.1) lib/carrierwave/orm/activerecord.rb:37:in `profile_image='
activerecord (3.2.2) lib/active_record/attribute_assignment.rb:85:in `block in assign_attributes'
activerecord (3.2.2) lib/active_record/attribute_assignment.rb:78:in `each'
activerecord (3.2.2) lib/active_record/attribute_assignment.rb:78:in `assign_attributes'
activerecord (3.2.2) lib/active_record/persistence.rb:212:in `block in update_attributes'
activerecord (3.2.2) lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
activerecord (3.2.2) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.2) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.2) lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
activerecord (3.2.2) lib/active_record/persistence.rb:211:in `update_attributes'
app/controllers/users_controller.rb:24:in `update_profile'