NameError:Heroku日志中未初始化的常量CarrierWave :: Storage :: Fog [英] NameError: uninitialized constant CarrierWave::Storage::Fog in Heroku Logs

查看:157
本文介绍了NameError:Heroku日志中未初始化的常量CarrierWave :: Storage :: Fog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我只是将AWS S3 Bucket添加到我的应用程序中。

Hello i just added AWS S3 Bucket to my app.

以下是应用程序错误 https://dry-atoll-6663.herokuapp.com/

在heroku日志中,当我$ heroku出现重新启动此错误

In heroku logs when i $heroku restart this error appears

2015-04-28T09:13:15.009823+00:00 app[web.1]: [3] ! Unable to load application: NameError: uninitialized constant CarrierWave::Storage::Fog

我的Carrierwave.rb

My Carrierwave.rb

CarrierWave.configure do |config|
config.fog_credentials = {
  # Configuration for Amazon S3
  :provider              => 'AWS',
  :aws_access_key_id     => ENV['S3_ACCESS_KEY'],
  :aws_secret_access_key => ENV['S3_SECRET_KEY']
}
config.fog_directory     =  ENV['S3_BUCKET']
end

有什么想法?我和我的朋友正在大伤脑筋......

Any ideas? Me and my friend are scratching our heads big time...

推荐答案

授予@Marcus正确回答评论的权利。

Credit @Marcus for correctly answering this in the comments.

在您的 config / initializers / carrierwave.rb 文件中,您需要更新

In your config/initializers/carrierwave.rb file, you will need to update

CarrierWave.configure do |config|
  # This is the old way, and broken
  config.storage = :fog

转换为

CarrierWave.configure do |config|
  # This is the new way!
  config.fog_provider = 'fog/aws'

请参阅 carrierwave github 获取更多信息。

这篇关于NameError:Heroku日志中未初始化的常量CarrierWave :: Storage :: Fog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆