开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜