开发者

Selecting Rails environment with "rails generate" command

开发者 https://www.devze.com 2023-02-04 10:22 出处:网络
I can start server/console, run a rake task in local environment using the following commands: rails s -e local

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消