B
B
Bogdan2018-03-30 17:17:16
Ruby on Rails
Bogdan, 2018-03-30 17:17:16

Read .env file variables?

Hello. Tell me please. And how to count the variables of the .env file correctly?
I googled gem dotenv But it seems to be only for development mode, but what should I use in production then ?
Server under Windows.
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Mirilaczvili, 2018-03-30
@bogdan_uman

The .env file is not intended for production
: the sysadmin must manually set the environment variables, either with the setx command in the bat file.
Environment variables can contain sensitive data that developers cannot know and also server addresses.

Z
Zaporozhchenko Oleg, 2018-03-30
@c3gdlk

Successfully using .env in production. Where does the opinion come from that it is not for production?

B
blackst0ne, 2018-03-31
@blackst0ne

You can use the same gem for production as well.
The whole point of moving data into ENV is not to write secrets in the source code, but to substitute them depending on the situation.
That is, in development we substitute one thing, and in production - another.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question