0

I'm getting this error when I run rake db:migrate db:seed on heroku for my rails publify blog

rake aborted!
ArgumentError: Missing required arguments: aws_access_key_id, aws_secret_access_key
/app/vendor/bundle/ruby/2.0.0/gems/fog-core-1.27.3/lib/fog/core/service.rb:244:in `validate_options'
/app/vendor/bundle/ruby/2.0.0/gems/fog-core-1.27.3/lib/fog/core/service.rb:268:in `handle_settings'
/app/vendor/bundle/ruby/2.0.0/gems/fog-core-1.27.3/lib/fog/core/service.rb:98:in `new'
/app/vendor/bundle/ruby/2.0.0/gems/fog-core-1.27.3/lib/fog/storage.rb:25:in `new'
/app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:83:in `eager_load_fog'
/app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:96:in `fog_credentials='
/app/config/initializers/carrierwave.rb:2:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:118:in `configure'
/app/vendor/bundle/ruby/2.0.0/gems/carrierwave-0.10.0/lib/carrierwave.rb:14:in `configure'
/app/config/initializers/carrierwave.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:241:in `load'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:241:in `block in load'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:232:in `load_dependency'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:241:in `load'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/engine.rb:648:in `block in load_config_initializer'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/notifications.rb:161:in `instrument'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/engine.rb:647:in `load_config_initializer'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/engine.rb:611:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/engine.rb:611:in `block in <class:Engine>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/initializable.rb:44:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/initializable.rb:44:in `tsort_each_child'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/application.rb:300:in `initialize!'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `block in require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:232:in `load_dependency'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `require'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/application.rb:276:in `require_environment!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.9/lib/rails/application.rb:405:in `block in run_tasks_blocks'

I've already set these arguments in the terminal for AWS according to the instructions on publify's github page - https://github.com/publify/publify

What am i missing?

Eli
  • 299
  • 5
  • 18
  • How did you set your `aws_access_key_id` and `aws_secret_access_key` arguments locally? You mentioned you set them in the terminal. Did you set them as environment variables? – vich Jan 20 '15 at 22:26
  • heroku config:set provider=AWS aws_access_key_id= "my access key id" aws_secret_access_key= "my secret access key" aws_bucket= "bucket name" – Eli Jan 20 '15 at 23:04
  • Can you confirm they are set? Run `heroku config` and see if the variables are set. – vich Jan 20 '15 at 23:21
  • here's what my carrierwave initializer looks like https://github.com/nerboda/myblog/blob/master/config/initializers/carrierwave.rb – Eli Jan 20 '15 at 23:23
  • what would i get if they are set? i ran it and it doesnt say anything about the access key id or secret access key – Eli Jan 20 '15 at 23:29
  • 1
    It should list the key-value pairs for your app's environment variables. Run these commands to add the AWS credentials: `heroku config:set AWS_ACCESS_KEY_ID=PasteTheKeyInHereNoQuotes` and `heroku config:set AWS_SECRET_ACCESS_KEY=PasteTheSecretKeyHereAlsoNoQuotes`. Then to confirm these are set, run `heroku config` and you should see both listed. Lastly, run `heroku run console` in the Terminal and type `ENV['AWS_ACCESS_KEY_ID']` and you should see the value of the key you added in the previous step. Then, re-run your migrations. – vich Jan 21 '15 at 15:30
  • alright so prefixing each command with heroku config:set was what i was missing. that did the trick. thanks so much for the help – Eli Jan 22 '15 at 19:47
  • Glad to hear it helped. I'll add an answer now. – vich Jan 22 '15 at 20:20

1 Answers1

1

Run these commands to add the AWS credentials: heroku config:set AWS_ACCESS_KEY_ID=PasteTheKeyInHereNoQuotes and heroku config:set AWS_SECRET_ACCESS_KEY=PasteTheSecretKeyHereAlsoNoQuotes. Then, to confirm these are set, run heroku config and you should see both listed. Lastly, run heroku run console in the Terminal and type ENV['AWS_ACCESS_KEY_ID'] and you should see the value of the key you added in the previous step. Then, re-run your migrations.

vich
  • 11,836
  • 13
  • 49
  • 66