I'm deploying a railsapp to ubuntu
rmagick is installed via "bundle install vendor". it installs , and the app runs -- but this error gets thrown :
uninitialized constant Image::Magick
when trying to read:
source_image = Magick::Image.read("#{Rails.root}/public/system/assets/#{self.id}/original/#{self.asset_file_name}").first
I've done the following:
I'm going a bit crazy trying to figure out what else I can do to make rmagick see imagemagick
After hours of fighting and recompiling imagemagick and rmagick under different combinations, I lucked out on a 1 line fix
Gemfile
- gem 'rmagick'
+ gem 'rmagick', :require => 'RMagick'
Bundler requires the gem name by default,
i.e. :require => 'rmagick'
.
But the file being included is actually 'RMagick.rb'. For case-insensitive file systems, like OS X, this will work, but for case-sensitive file systems, like Ubuntu, the file will not be found.
This can be one of the reasons why the error can't be produced on the dev system, even when running in production mode.
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