So, I'm using Figaro to store my secret twitter, and Facebook oauth keys so I can deploy to Heroku properly. I'd just like to confirm that I am doing it right.
In my application.yml (generated by figaro):
// Add application configuration variables here, as shown below.
//
// PUSHER_APP_ID: "2954"
// PUSHER_KEY: 7381a978f7dd7f9a1117
// PUSHER_SECRET: abdc3b896a0ffb85d373
// STRIPE_API_KEY: EdAvEPVEC3LuaTg5Q3z6WbDVqZlcBQ8Z
// STRIPE_PUBLIC_KEY: pk_BRgD57O8fHja9HxduJUszhef6jCyS
// note these are arbitrary keys for the stack overflow
FR_FACEBOOK_KEY=1231231233123123
FR_FACEBOOK_SECRET=3123123123123
TWITTER_CONSUMER_KEY=12312312312312
TWITTER_CONSUMER_SECRET=1312312312312
So that's the application.yml, then I simply need to run:
heroku config:add FR_FACEBOOK_KEY=8926 // and so on...
correct?
Or am I missing something?
Thanks in advanced!
When I run rake figaro:heroku I'm getting this error:
[new_work]$rake figaro:heroku
rake aborted!
undefined method `reject' for #<String:0x007fbdc6c0e2a8>
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/figaro-0.7.0/lib/figaro.rb:39:in `flatten'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/figaro-0.7.0/lib/figaro.rb:17:in `env'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/figaro-0.7.0/lib/figaro/railtie.rb:7:in `block in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0.rc1/lib/active_support/lazy_load_hooks.rb:36:in `call'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0.rc1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0.rc1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0.rc1/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0.rc1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0.rc1/lib/rails/application.rb:67:in `inherited'
/Users/usr/Sites/new_work/config/application.rb:22:in `<module:Friendiose>'
/Users/usr/Sites/new_work/config/application.rb:21:in `<top (required)>'
/Users/usr/Sites/new_work/Rakefile:5:in `require'
/Users/usr/Sites/new_work/Rakefile:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
Remember to use
:
instead of=
to separate your keys and values. You can access the keys from your rails app usingENV["KEY_NAME"]
However, you do not have to
heroku config:add
keys while you have Figaro, just userake figaro:heroku
as explained here https://github.com/laserlemon/figaro