Suppress Output in Rake Task db:schema:load

后端 未结 2 460
走了就别回头了
走了就别回头了 2020-12-18 00:11

How can you suppress the output of db:load:schema? Running

bundle exec rake db:schema:load

with the -s, -q, or ev

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 00:52

    Instead of calling the task with Rake::Task['...'].invoke, you can run the command in a subshell, redirecting output to /dev/null.

    system "bundle exec rake db:schema:load > /dev/null 2>&1"
    

提交回复
热议问题