Carrierwave / Fog / S3 “is not a recognized storage provider”

前端 未结 2 1030
旧时难觅i
旧时难觅i 2021-02-08 17:08

I have a Rails app that is using Carrierwave for file uploads. It has been working fine but I want to start using Amazon S3 for my image storage. I am getting this error:

<
相关标签:
2条回答
  • 2021-02-08 17:50

    OK, I'm an idiot. :)

    At some point, I don't know where, I added a fog.rb file with my CarrierWave configuration to the lib/carrierwave/storage directory. I got desperate, paid for a Railscasts subscription so I could watch episode #383 (http://railscasts.com/episodes/383-uploading-to-amazon-s3?autoplay=true) and at 3:02 I found the error of my ways. The Carrierwave configuration needed to be placed in config/initializers/carrierwave.rb.

    I don't know where I got this other location but once I moved the config to the proper location, everything is good.

    0 讨论(0)
  • 2021-02-08 17:56

    I just ran into the same problem, and people must be aware that any typo in the config file : "config/initializers/carrierwave.rb", leads to that error.

    0 讨论(0)
提交回复
热议问题