本文介绍了Carrierwave和S3与Heroku的错误未定义的方法`fog_credentials ='的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装carrierwave和S3与Heroku的。我下面的carrierwave文档正是: https://github.com/jnicklas/carrierwave

I'm trying to setup carrierwave and s3 with heroku. I'm following the carrierwave docs exactly: https://github.com/jnicklas/carrierwave

我已经安装了一桶名为testbucket在AWS,然后我安装了雾灯,创造了一个新的初始化与这里面的:

I've setup a bucket named testbucket in AWS, then I installed fog and created a new initializer with this inside :

CarrierWave.configure do |config|
  config.fog_credentials = {
    :provider               => 'AWS',       # required
    :aws_access_key_id      => 'my_key_inside_here',       # required
    :aws_secret_access_key  => 'my_secret_access_key_here',       # required
    :region                 => 'eu-west-1'  # optional, defaults to 'us-east-1'
  }
  config.fog_directory  = 'testbucket'                     # required

end

然后我image_uploader.rb里面我设置

Then inside my image_uploader.rb I set

 storage :fog

有没有别的东西,我很想念???感谢您的帮助。

Is there something else I am missing??? Thanks for any help.

推荐答案

如果您使用的是载波0.5.2,你必须寻找创业板中的文档。他们比你在github上看到的不同。具体来说,检查出的宝石本文件:LIB / carrierwave /存储/ s3.rb

If you're using carrier-wave 0.5.2, you have to look in the docs within the gem. They are different than what you see on github. Specifically, check out this file in the gem: lib/carrierwave/storage/s3.rb

另外设置商店:S3 ...不是:雾。你会看到这样的内容:

Also set store to :s3...not :fog.You'll see this section:

#     CarrierWave.configure do |config|
#       config.s3_access_key_id = "xxxxxx"
#       config.s3_secret_access_key = "xxxxxx"
#       config.s3_bucket = "my_bucket_name"
#     end
#

这篇关于Carrierwave和S3与Heroku的错误未定义的方法`fog_credentials ='的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 17:29