how to add environment variable in linux for rails app?

Viewed 1489

i need to set an environment variable for the rails app to use

SECRET_KEY_BASE=9941144eb255ff0ffecasdlkjqweqwelkjasdlkjasd

the config settings for production is as shown below

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

how can i set the environment variable using the linux command

export VARNAME="my value" 

I tried to set the variable but looks like it needs to be for the right user. Sorry i am not an expert in linux. I appreciate any help! Thanks!

2 Answers
Related