attachment_fu / RMagick / ImageMagick
Posted by: Junesun
Posted on: 2007-11-23 08:03:00
For my social networking site programmed in Ruby on Rails I need to be able to crop+resize uploaded images. I am using a slightly changed attachment_fu for this and it works fine locally (in Webrick), but not on my Dreamhost site, even though I made sure the Vendor folder and all changed files were correctly transferred and that dispatch.fcgi restarted.
I get the error "undefined method `crop_resized!' for /tmp/CGI15859-1 JPEG 480x360 DirectClass 8-bit 25094b:Magick::Image" and the following trace:
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb:46:in `resize_image'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb:46:in `change_geometry'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb:46:in `resize_image'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:379:in `resize_image_or_thumbnail!'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb:32:in `process_attachment'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb:22:in `call'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb:22:in `with_image'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:317:in `with_image'
#{RAILS_ROOT}/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb:31:in `process_attachment'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:333:in `callback'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:330:in `callback'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:301:in `valid?'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/validations.rb:751:in `save_without_transactions'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:129:in `save'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:95:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:121:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/transactions.rb:129:in `save'
#{RAILS_ROOT}/app/controllers/share_controller.rb:175:in `upload_idea'
Can anybody help me get this to work?
I thought it might be a problem with an outdated version of RMagick, but Dreamhost appears to be running an up-to-date version of it. Maybe it's ImageMagick? How can I tell? Or would anybody happen to know of a different way to crop+resize images, so that I don't need to use this function? I'm really not very knowledgeable about graphics programming, just RoR in general.