I'm getting an error in thumbnail.rb saying :geometry is empty
Here's a condensed version of the stack:
NoMethodError in PagesController#create
undefined method `[]' for 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 I find to be rather weird is that it works fine on my local machine, and not sporadically on my server.
My has_attached_file looks like 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 help would be immensely useful, as I haven't been able to find anything that fixes this on google. Here's a github issue as well, if you care to reply there instead/as