【问题标题】:Why only the first "rake" command is executed in a batch file?为什么在批处理文件中只执行第一个“rake”命令?
【发布时间】:2011-01-14 11:40:23
【问题描述】:

我在 Windows 上创建了reset_db.bat,内容如下:

rake db:drop RAILS_ENV=development
rake db:create
rake db:migrate
rake db:seed

当我输入 reset_db 时,只执行第一个命令 (drop)。为什么?

【问题讨论】:

    标签: ruby-on-rails windows ruby-on-rails-3 batch-file rake


    【解决方案1】:

    我假设 rake 也是一个 .bat 文件。

    那么你只需要在前面加上一个电话

    call rake db:drop RAILS_ENV=development
    call rake db:create
    call rake db:migrate
    call rake db:seed
    

    【讨论】:

      猜你喜欢
      • 2011-05-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-10
      • 2011-12-15
      • 2022-11-28
      • 2011-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多