Selecting Rails environment with "rails generate" command
I can start server/console, run a rake task in local
environment using the following commands:
rails s -e local
rails c local
rake RAILS_ENV=local db:migrate
How can I run rails generate (or rails g)
in local
env开发者_运维知识库ironment?
RAILS_ENV=local rails g ...
Ought to work. That's setting the env var with the shell rather than relying on rails reading a command line option.
精彩评论