How to load environment variables in the Rails console? -


i think little, easy question!

i'm using .env file keep environment variables, , i'm using foreman.

unfortunately, these environment variables not being loaded when running rails console rails c so, i'm loading them manually after running console, not best way.

i'd know if there better way that.

about year ago, "run" command added foreman

ref: https://github.com/ddollar/foreman/pull/121

you can use follow:

foreman run rails console

or

foreman run rake db:migrate


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -