Heroku environment target
desc 'Set up heroku env'
task :heroku do
Bundler.with_clean_env{ `heroku config | tail -n+2 | awk '{ print $1 $2 }'`.chop }.each_line do |env_var|
var, value = env_var.split(':', 2)
ENV[var.strip] = value.strip
end
end
Then you can run your targets like:
rake heroku db:seed
Written by Carlos Júnior
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#