ruby on rails - Why would Paperclip be failing to find the geometry key when on my server? -


i'm getting error in thumbnail.rb saying :geometry empty

here's condensed version of stack:

nomethoderror in pagescontroller#create  undefined method `[]' nil:nilclass  rails_root: ... application trace | framework trace | full trace  .../vendor/plugins/paperclip/lib/paperclip/thumbnail.rb:18:in `initialize' .../vendor/plugins/paperclip/lib/paperclip/processor.rb:33:in `new' .../vendor/plugins/paperclip/lib/paperclip/processor.rb:33:in `make' .../vendor/plugins/paperclip/lib/paperclip/attachment.rb:295:in `post_process_styles' .../usr/lib/ruby/1.8/erb.rb:719:in `inject' .... 

the thing find rather weird works fine on local machine, , not sporadically on server.

my has_attached_file looks so:

  has_attached_file :foreground,                     :storage => :s3,                     :s3_credentials => "#{rails_root}/config/amazon_s3.yml",                     :bucket => 'recurse',                     :path => ":attachment/:id_partition/:token/:style/:filename",                     :styles => {                       :medium => {:geometry => '372x251>'},                       :small => {:geometry => '188x156>'},                       :original_strip => {:geometry => '100x100%', :processors => [:cropper]},                       :medium_strip => {:geometry => '100x100%', :processors => [:mediumcropper]},                       :small_strip => {:geometry => '100x100%', :processors => [:smallcropper]},                     }    has_attached_file :background,                     :storage => :s3,                     :s3_credentials => "#{rails_root}/config/amazon_s3.yml",                     :bucket => 'recurse',                     :path => ":attachment/:id_partition/:token/:style/:filename",                     :styles => {                       :medium => {:geometry => '372x251>'},                       :small => {:geometry => '188x156>'}                     } 

and thumbnail.rb:18 has @crop on it...

  geometry             = options[:geometry]   @file                = file   @crop                = geometry[-1,1] == '#'   @target_geometry     = geometry.parse geometry   @current_geometry    = geometry.from_file @file 

any immensely useful, haven't been able find fixes on google. here's github issue well, if care reply there instead/as

style.rb lines 18-21 need be:

    @geometry = definition[:geometry]     @format = definition[:format]     @processors = definition[:processors]     @other_args = definition.reject {|key,value|[:geometry, :format, :processors].include?(key)} 

http://groups.google.com/group/paperclip-plugin/browse_thread/thread/c2f5a7ae58fff976


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -