현재 지연된 작업을 통해 실행중인 클래스가 있습니다. 그 중 하나는 "rake spec"을 실행하고 출력을 재지향하는 것입니다.Delayed_Job 레이크를 실행하지 않고 출력을 리디렉션하지 않습니다.
나는 같은이 작업을 수행 :
class Executor
def execute_command(cmd, &block)
STDOUT.sync = true # That's all it takes...
IO.popen(cmd + " 2>&1") do |pipe| # Redirection is performed using operators
pipe.sync = true
while str = pipe.gets
block.call str # This is synchronous!
end
end
return $?.success?
end
end
그러나, 출력 중 어느 것도 표시되지 않습니다 그것도 제대로 단위 테스트를 실행할 인식하지 않습니다.
카피 스트라 노가 작동하며 OSX에서 작동합니다. 내 서버는 우분투 승객입니다.
누구나 출력이 리디렉션되지 않는 이유는 무엇입니까? 여기에 cmd를 에 STDFDES 리디렉션없이
감사
벤