S
S
Sergey Toy2014-07-04 09:41:12
Nginx
Sergey Toy, 2014-07-04 09:41:12

How to set separate environment variables for each Rails application (rvm, passenger, nginx)?

In one of the updates to the Rails 4.1.x branch, I noticed that some variables are now taken from the environment. For example in config/secrets.yml :

production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

Adding via export to .bashrc will not work, because I can have several applications running on one user that need their own SECRET_KEY_BASE (although you can rename the variable for each application).
Actually the question is, is it possible to somehow add SECRET_KEY_BASE and other variables for each Rails application, for example, through the config in nginx or rvm?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iamnothing, 2014-07-04
@iamnothing

on the Internet they write that there is such a gem 'figaro', and you can specify environment variables in its config.
And anyway, Google gives a lot of interesting things

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question