On staging, I'm facing the following error on uploading and resizing an image through carrierwave and minimagick. On local everything works fine.
carrierwave (0.9.0) mini_magick (3.7.0)
irb(main):003:0> PicturePost.create(remote_content_url: 'http://www.imagpress.com/img/slider/slider_1.jpg') NoMethodError: undefined method `size' for nil:NilClass from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick.rb:24:in `choose_processor' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick.rb:64:in `mogrify?' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:360:in `run_command' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:171:in `valid?' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:140:in `create' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:48:in `read' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:111:in `block in open' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:110:in `open' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/mini_magick-3.7.0/lib/mini_magick/image.rb:110:in `open' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/processing/mini_magick.rb:260:in `manipulate!' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/processing/mini_magick.rb:176:in `resize_to_fill' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/processing.rb:85:in `block in process!' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/processing.rb:81:in `each' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/processing.rb:81:in `process!' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/callbacks.rb:18:in `block in with_callbacks' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/callbacks.rb:18:in `each' 9 levels... from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/download.rb:65:in `download!' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/mount.rb:353:in `remote_url=' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/mount.rb:203:in `remote_content_url=' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/orm/activerecord.rb:44:in `remote_content_url=' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/attribute_assignment.rb:85:in `block in assign_attributes' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/attribute_assignment.rb:78:in `each' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/attribute_assignment.rb:78:in `assign_attributes' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/base.rb:498:in `initialize' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/persistence.rb:44:in `new' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.15/lib/active_record/persistence.rb:44:in `create' from (irb):3 from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/railties-3.2.15/lib/rails/commands/console.rb:47:in `start' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/railties-3.2.15/lib/rails/commands/console.rb:8:in `start' from /home/deploy/apps/staging/blog/shared/bundle/ruby/1.9.1/gems/railties-3.2.15/lib/rails/commands.rb:41:in `<top (required)>' from script/rails:6:in `require'
Can't figure out why this is happening.
Had forgotten to install imagemagick on my new server. This solved the issue for me
sudo apt-get install imagemagick
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With