Monday, November 9, 2009

Paperclip - Passenger problem

Today I had very strange problem with paperclip. Application worked fine for image upload. I set it up with passenger and suddenly I noticed an error while uploading. Something like ".../tmp/stream..... is not recognized by the 'identify' command" in my flash[:error]. After some investigations it turned out that everything works with mongrel but not with passenger. Problem is solved by adding /config/initializers/paperclip-passenger-fix.rb with just one line:

Paperclip.options[:image_magick_path] = '/usr/local/bin' # or whereever your imagemagick is ( find out with 'which identify' in your terminal

Tuesday, November 3, 2009

Helpers in Rails Engines

One more info for using Rails Engines. Helpers are not included automatically. You need to place

config.to_prepare do
ApplicationController.helper(MyEngineHelper)
end

in init.rb of your plugin