7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CarrierWave のストレージに fog を使い、S3にファイルを保存したい際に uninitialized constant CarrierWave::Storage::Fog というエラーが出る場合の対処

Last updated at Posted at 2015-11-25

問題

CarrierWave のストレージに fog を使い、保存先を Amazon S3 にしたい場合、

CarrierWave のドキュメント carrierwaveuploader/carrierwave の設定を参考に fog-aws を導入するとエラーとなります。

gem 'fog-aws'

uninitialized constant CarrierWave::Storage::Fog
# backtrace line: ~/app/config/initializers/carrierwave.rb:4 (see below)

解決

fog-aws の代わりに fog を使いましょう。

gem 'fog'

fog 側で Issue となっています。
CarrierWave 側でファイルが require されていなく、fog側で fog-storage のような gem を提供するなど、別の対応を考えているようです。
https://github.com/fog/fog/issues/3429

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?