By plaksel
this is driving me crazy for a few days now and I can’t figure out how to solve this. I am new to this so it might just be something very simple.
I set up my VPS hosting on Ubuntu 14.04 using Digital Ocean to deploy my Rails 4 app to a production environment. I deployed my app using Capistrano and Nginx by following this tutorial https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma
The only problem that I currently have is that my environment variables are not loaded by my app. Or at least, when I try to subscribe to my newsletter, it tells me that a valid api key is required.
What I did so far:
This is my bash_profile file:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM$
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
export MAILCHIMP_API_KEY="somenumber"
export MAILCHIMP_LIST_ID="somenumber"
Happy to add any extra code if required.
Thanks a lot!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’m also new to this kind of thing so forgive me if this is the n00b way to do it:
export SOME_ENV_VAR=some_value
set :default_env, { ‘SOME_ENV_VAR’ => ‘some_value’ }
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.