0

Everything has been great. Until I checked out a new branch, and now I get this error. I use figaro which generated an application.yml to store the env variables for the aws credentials. I have successfully been able to deploy to heroku and use my aws keys to upload pics, etc. to my bucket. Then I checkout a new branch and this error. I even went back to the old branch where everything was just peachy and this error won't go away. I'm frustrated. I even go into the terminal and do echo $aws_access_key_id and I don't get nil, I get the access key. Something doesn't add up...

fog.rb

CarrierWave.configure do |config|
  config.fog_credentials = {
    provider: 'AWS',
    aws_access_key_id: ENV['aws_access_key_id'],
    aws_secret_access_key: ENV['aws_secret_access_key'],
    region: 'us-east-1'
  }

      config.fog_directory = ENV['AWS_BUCKET']

  if Rails.env.development? || Rails.env.test?
    CarrierWave.configure do |config|
      config.storage = :file
    end
  end

  # Use AWS storage if in production
  if Rails.env.production?
    CarrierWave.configure do |config|
      config.storage = :fog
    end
  end
end

application.yml

aws_access_key_id: "key"
aws_secret_access_key: "key"
dmberko11
  • 427
  • 7
  • 17
  • Perhaps try using `puts` to output the ENV values from inside the ruby file, it may be that even though they appear at terminal the ruby/figaro setup are not cooperating. – geemus Oct 31 '18 at 19:29
  • I actually just reinstalled Figaro and had it override the old application.yml the keys used to be stored in and then I added them again. Fixed it – dmberko11 Oct 31 '18 at 19:35

0 Answers0