从Ruby gem中运行`system'rake'`:如何抑制控制台输出?

时间:2014-01-19 13:14:50

标签: ruby logging console gem rake

我必须在Ruby gem中运行system "rake assets:precompile"

如何防止它向控制台输出任何内容?目前它正在输出以下内容:

I, [2014-01-19T14:11:19.599828 #76714]  INFO -- : Writing /Users/josh/Documents/Work/MuheimWebdesign/transition/public/assets/application-90b828df450eb4e5dd0b88931da42ead.js
I, [2014-01-19T14:11:19.929472 #76714]  INFO -- : Writing /Users/josh/Documents/Work/MuheimWebdesign/transition/public/assets/application-b1bed1c63f05b07c72f1ac7e31b65551.css

1 个答案:

答案 0 :(得分:2)

您可以将输出重定向到a place nothing ever happens

system "rake assets:precompile &> /dev/null"