kbingman / paperclipped

Please note, this extension is no longer being developed. Please take a look at the radiant-clipped-extension instead. Radiant extension for managing assets and images with the Paperclip plugin.
Other
122 stars 64 forks source link

wrong number of arguments in validates_attachment_size during upload #40

Closed daveharris closed 12 years ago

daveharris commented 12 years ago

Hi, When I try to upload a new asset, I get the below an error message

I have an older application running on

I am wondering whether there is an incompatibility between the version of rails/radiant/paperclip/paperclipped?

I can't' find out what version of paperclipped I am running, how can I tell? Looking at paperclipped_extension.rb the version says 0.8.0, but looking at the latest release of paperclipped the version is still 0.8.0

What version of paperclip do I need to run with paperclipped for Radiant 0.8.2?

Thanks, Dave

The error message is:

/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `validates_attachment_size'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `[]'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `allow_validation?'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:274:in `validate'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `each'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `validate'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:93:in `assign'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:204:in `asset='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `each'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2438:in `initialize'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `new'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `create'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/flash.rb:146:in `perform_action'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `sass_old_process'
/Users/dave/code/app/vendor/radiant/vendor/plugins/haml/lib/sass/plugin/rails.rb:19:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:437:in `call'

The request attributes are:

{"commit"=>"Create Asset",
 "format"=>"html",
 "authenticity_token"=>"2TOdLSQ/KEnE6IR0VVxd2OlfhoAH+9OqGUvj3TIPYGs=",
 "asset"=>{"title"=>"moving-house-image",
 "caption"=>"",
 "asset"=>#<File:/var/folders/yd/c5x54_ps3j1dmwzmd7drdtbh0000gn/T/RackMultipart20111202-45084-8paokl-0>}}
kbingman commented 12 years ago

Hi Dave,

I think you need stick to older versions of paperclip. 2.3.1 will not work. I am not sure, as Paperclipped is no longer supported and I have not used it in some time, but I think 2.0.8 or so should work.

I highly encourage you to update to Clipped, it is the replacement for Paperclipped and now a part of the basic Radian package.

Keith

On Dec 1, 2011, at 11:13 PM, Dave Harris wrote:

Hi, When I try to upload a new asset, I get the below an error message

I have an older application running on

  • Papercliped version 2.2.8
  • Paperclip version 2.3.1 (vendorized)
  • Radiant version 0.8.2
  • Rails version 2.3.4
  • Ruby version 1.8.7 (i686-darwin11.0.0)
  • RubyGems version 1.4.2
  • Rack version 1.0

I am wondering whether there is an incompatibility between the version of rails/radiant/paperclip/paperclipped?

What version of paperclip do I need to run with paperclipped v2.2.8?

Thanks, Dave

The error message is:

/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `validates_attachment_size'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `[]'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `allow_validation?'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:274:in `validate'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `each'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `validate'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:93:in `assign'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:204:in `asset='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `each'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2438:in `initialize'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `new'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `create'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/flash.rb:146:in `perform_action'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `sass_old_process'
/Users/dave/code/app/vendor/radiant/vendor/plugins/haml/lib/sass/plugin/rails.rb:19:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:437:in `call'

The request attributes are:

{"commit"=>"Create Asset",
"format"=>"html",
"authenticity_token"=>"2TOdLSQ/KEnE6IR0VVxd2OlfhoAH+9OqGUvj3TIPYGs=",
"asset"=>{"title"=>"moving-house-image",
"caption"=>"",
"asset"=>#<File:/var/folders/yd/c5x54_ps3j1dmwzmd7drdtbh0000gn/T/RackMultipart20111202-45084-8paokl-0>}}

Reply to this email directly or view it on GitHub: https://github.com/kbingman/paperclipped/issues/40

daveharris commented 12 years ago

Hi Keith, Thanks for the quick response! I will look into those things on Monday, but I think downgrading paperclip will be the best solution in this instance I will let you know how it goes

Dave

On 2/12/2011, at 9:19 PM, Keith Bingman reply@reply.github.com wrote:

Hi Dave,

I think you need stick to older versions of paperclip. 2.3.1 will not work. I am not sure, as Paperclipped is no longer supported and I have not used it in some time, but I think 2.0.8 or so should work.

I highly encourage you to update to Clipped, it is the replacement for Paperclipped and now a part of the basic Radian package.

Keith

On Dec 1, 2011, at 11:13 PM, Dave Harris wrote:

Hi, When I try to upload a new asset, I get the below an error message

I have an older application running on

  • Papercliped version 2.2.8
  • Paperclip version 2.3.1 (vendorized)
  • Radiant version 0.8.2
  • Rails version 2.3.4
  • Ruby version 1.8.7 (i686-darwin11.0.0)
  • RubyGems version 1.4.2
  • Rack version 1.0

I am wondering whether there is an incompatibility between the version of rails/radiant/paperclip/paperclipped?

What version of paperclip do I need to run with paperclipped v2.2.8?

Thanks, Dave

The error message is:

/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `validates_attachment_size'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `[]'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `allow_validation?'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:274:in `validate'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `each'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `validate'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:93:in `assign'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:204:in `asset='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `each'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2438:in `initialize'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `new'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `create'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/flash.rb:146:in `perform_action'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `sass_old_process'
/Users/dave/code/app/vendor/radiant/vendor/plugins/haml/lib/sass/plugin/rails.rb:19:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:437:in `call'

The request attributes are:

{"commit"=>"Create Asset",
"format"=>"html",
"authenticity_token"=>"2TOdLSQ/KEnE6IR0VVxd2OlfhoAH+9OqGUvj3TIPYGs=",
"asset"=>{"title"=>"moving-house-image",
"caption"=>"",
"asset"=>#<File:/var/folders/yd/c5x54_ps3j1dmwzmd7drdtbh0000gn/T/RackMultipart20111202-45084-8paokl-0>}}

Reply to this email directly or view it on GitHub: https://github.com/kbingman/paperclipped/issues/40


Reply to this email directly or view it on GitHub: https://github.com/kbingman/paperclipped/issues/40#issuecomment-2987504

daveharris commented 12 years ago

Hi Keith, I have tired replacing paperclip but couldn't find the version 2.0.8 you say. Looking at the https://github.com/thoughtbot/paperclip/tags page, I have tried both versions 2.0.2 and 2.1.0, but they both fail.

2.0.2 fails before the file upload process even starts with a

NameError: uninitialized constant Tempfile
~/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant'
~/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
~/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
~/code/app/vendor/gems/thoughtbot-paperclip-2.0.2/lib/paperclip/thumbnail.rb:72

2.1.0 seems to work with the app, but when attempting to upload an image I get

undefined method `call' for #<Array:0x109d3e668>
app/vendor/gems/thoughtbot-paperclip-2.1.0/lib/paperclip/attachment.rb:179:in `validate'
app/vendor/radiant/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:211:in `collect'

I probably shouldn't be asking you, but do you have any ideas?

Dave