MiniMagick not working in production

妖精的绣舞 提交于 2019-12-13 04:19:34

问题


I am using MiniMagick gem to crop images and then saving them with mongoid paperclip. Everything seems to be working perfectly in development but in production I am getting the error "ActionView::Template::Error (uninitialized constant Model Name::MiniMagick)". these are the lines giving the error inside the model:

def profile_geometry
  img = MiniMagick::Image.open(avatar.path)
  @geometry = {:width => img[:width], :height => img[:height] }
end

Any help would be hugely appreciated.

EDIT: Gemfile

gem 'rails', '4.0.0'

gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jbuilder', '~> 1.2'
gem 'twitter-bootstrap-rails'
gem 'quiet_assets'

group :development do
    gem 'awesome_print'
end

group :production do 
    gem 'unicorn'
end

group :doc do
  gem 'sdoc', require: false
end

gem 'mini_magick'
gem 'execjs'
gem 'therubyracer'
gem "mongoid", "~> 4.0.0.beta1"
gem "devise"
gem "mongoid-paperclip", :require => "mongoid_paperclip"
gem "cancan"
gem "simple-rss"
gem 'capistrano'
gem 'rvm-capistrano'

gem 'stripe'

回答1:


Well it was the restart that did it. After restarting nginx and unicorn several times I restarted the rackspace server completely and everything is fine now.



来源:https://stackoverflow.com/questions/23798045/minimagick-not-working-in-production

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!