MiniMagick不在生产中

时间:2014-05-22 04:50:30

标签: ruby-on-rails mongoid paperclip minimagick

我正在使用MiniMagick gem来裁剪图像,然后使用mongoid paperclip保存它们。一切似乎都在开发中完美运行但在生产中我收到错误“ActionView :: Template :: Error(未初始化的常量模型名称 :: MiniMagick)”。这些是在模型中给出错误的行:

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

非常感谢任何帮助。

编辑: 的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 个答案:

答案 0 :(得分:0)

这是重启,它做到了。在重新启动nginx和unicorn几次后,我完全重新启动了rackspace服务器,现在一切都很好。