MiniMagick无法在生产中使用 [英] MiniMagick not working in production
问题描述
我正在使用MiniMagick宝石来裁剪图像,然后使用蒙古型回形针保存它们.一切似乎在开发中都工作正常,但是在生产中,我收到错误消息"ActionView :: Template :: Error(未初始化的常量模型名称 :: MiniMagick)".这些是在模型内部产生错误的线:
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
任何帮助将不胜感激.
宝石文件
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'
推荐答案
好吧,是重启后才完成的.几次重新启动nginx和unicorn之后,我完全重新启动了机架空间服务器,现在一切都很好.
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.
这篇关于MiniMagick无法在生产中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!