gem 'fog'とcarrierwaveを利用して画像をAWS S3に保存しようとしたのですがrails sで試してみようとすると以下のエラーが出て立ち上がりません。
アプリケーションに画像を保存するところまでは使えていました。
/Users/ユーザーネーム/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/carrierwave-1.0.0/lib/carrierwave/uploader/configuration.rb:77:in `eval': uninitialized constant CarrierWave::Storage::Fog (NameError)
config/initializers/carrierwave.rb
1CarrierWave.configure do |config| 2 config.storage = :fog 3 config.fog_credentials = { 4 provider: 'AWS', 5 aws_access_key_id: ENV['ACCESS_KEY_ID'], 6 aws_secret_access_key: ENV['SECRET_ACCESS_KEY'], 7 region: 'us-east-1' 8 } 9 10 case Rails.env 11 when 'development' 12 config.fog_directory = 'バスケット名' 13 config.asset_host = 'https://s3.amazonaws.com/バスケット名' 14 when 'production' 15 config.fog_directory = 'バスケット名' 16 config.asset_host = 'https://s3.amazonaws.com/バスケット名' 17 end 18end
以下の質問と似ていたのでその回答に書いてあった
carrierwaveを使ってAWS S3に画像を保存する方法
$ cat>lib/fog.rb<<EOT module Fog end EOT
これも試したみたのですが解決しませんでした。
version
fog 1.38.0
rmagick 2.16.0
carrierwave 1.0.0
fog をbundle installした時に他にも新たに
Installing CFPropertyList 2.3.5
Installing excon 0.55.0
Installing formatador 0.2.5
Installing ipaddress 0.8.3
Installing xml-simple 1.1.5
Installing inflecto 0.0.2
Installing trollop 2.1.2
Installing fission 0.5.0
Installing fog-core 1.43.0
Installing rbvmomi 1.9.4
Installing fog-json 1.0.2
Installing fog-xml 0.1.2
Installing fog-local 0.3.1
Installing fog-vmfusion 0.1.0
Installing fog-vsphere 1.7.0
Installing fog-aliyun 0.1.0
Installing fog-brightbox 0.11.0
Installing fog-openstack 0.1.19
Installing fog-profitbricks 3.0.0
Installing fog-sakuracloud 1.7.5
Installing fog-serverlove 0.1.2
Installing fog-softlayer 1.1.4
Installing fog-storm_on_demand 0.1.1
Installing fog-atmos 0.1.0
Installing fog-aws 1.2.0
Installing fog-cloudatcost 0.1.2
Installing fog-dynect 0.0.3
Installing fog-ecloud 0.3.0
Installing fog-google 0.1.0
Installing fog-powerdns 0.1.1
Installing fog-rackspace 0.1.4
Installing fog-radosgw 0.0.5
Installing fog-riakcs 0.1.0
Installing fog-terremark 0.1.0
Installing fog-voxel 0.1.0
Installing fog-xenserver 0.2.3
これらがインストールされていて
ググっていたらgem fog-awsでエラーが出ているのをいくつか見つけたのでこれの影響だったりするのでしょうか?
gem fileでは gem 'fog'しか書いておらず
gem 'fog-aws'は書いてません。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。