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
Post a Comment