Problems Setting Environment Variable on Ubuntu | Ruby on Rails

by Jake   Last Updated September 21, 2018 03:01 AM

I have tried to set my environment variables multiple ways on my Ubuntu server but nothing seems to work. I need to know how to properly set them on the digital ocean droplet I am using to host my website.

I have tried the following:

  1. By using a file called and putting all of the variable exports in there on different lines: export ENVIRONMENT_VARIABLE=TheValue
  2. By simply entering export ENVIRONMENT_VARIABLE=TheValue in the Ubuntu terminal as the user for my application (not as root)
  3. I've also tried to use set ENVIRONMENT_VARIABLE=TheValue but that doesn't work either.

After echoing the variable for the last 2, it gave me back the correct value. I did it by typing this in the terminal: echo $VARIABLE_NAME

Thanks for any help!

Related Questions

Debugging env vars from ssh

Updated January 13, 2016 12:00 PM