Fix for rake paperclip:refresh #669

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

npadgett commented Dec 8, 2011

When running rake paperclip:refresh, I receive the error message below. I noticed that the rest of the paperclip code performed a to_s on the content type before strip was called.

rake aborted!
undefined method strip' for image/bmp:MIME::Type /app/.bundle/gems/ruby/1.9.1/gems/paperclip-2.4.5/lib/tasks/paperclip.rake:50:inblock (5 levels) in <top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/paperclip-2.4.5/lib/paperclip.rb:144:in block in each_instance_with_attachment' /app/.bundle/gems/ruby/1.9.1/gems/paperclip-2.4.5/lib/paperclip.rb:143:ineach'
/app/.bundle/gems/ruby/1.9.1/gems/paperclip-2.4.5/lib/paperclip.rb:143:in each_instance_with_attachment' /app/.bundle/gems/ruby/1.9.1/gems/paperclip-2.4.5/lib/tasks/paperclip.rake:47:inblock (4 levels) in <top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/paperclip-2.4.5/lib/tasks/paperclip.rake:46:in each' /app/.bundle/gems/ruby/1.9.1/gems/paperclip-2.4.5/lib/tasks/paperclip.rake:46:inblock (3 levels) in <top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain' /usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:inblock in invoke_prerequisites'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in each' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:ininvoke_prerequisites'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in block in invoke_with_call_chain' /usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock (2 levels) in top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock in top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in block in run' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in<top (required)>'
/app/.bundle/gems/ruby/1.9.1/bin/rake:19:in load' /app/.bundle/gems/ruby/1.9.1/bin/rake:19:in

'
Tasks: TOP => paperclip:refresh => paperclip:refresh:metadata

Standardize strip with resy of application. Without to_s, causes erro…
…rs like "undefined method `strip' for image/bmp:MIME::Type".
Contributor

sikachu commented Dec 12, 2011

This has been merged in 34913f1

@sikachu sikachu closed this Dec 12, 2011

@sikachu sikachu referenced this pull request Dec 12, 2011

Closed

Fix on rake task #670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment