Choosing a Rails Environment with the "rails generate" Command

I can start the server / console, run the rake task in the environment localusing the following commands:

rails s -e local    

rails c local

rake RAILS_ENV=local db:migrate

How to run rails generate (or rails g)in the environment local?

+3
source share
1 answer
RAILS_ENV=local rails g ...

Must work. This is an env var installation with a shell instead of relying on rails reading the command line parameter.

+13
source

Source: https://habr.com/ru/post/1785290/


All Articles