0
我嘗試了所有的代碼(主要是POPEN或開創業板)的SO的帖子和博客這樣的 - http://blog.bigbinary.com/2012/10/18/backtick-system-exec-in-ruby.html如何在Windows中使用popen3庫?
沒有什麼工作,因爲錯誤的 -
C:/svn/ruby/lib/ruby/1.8/open3.rb:57:in `fork': fork() function is unimplemented on this machine (NotImplementedError)
from C:/svn/ruby/lib/ruby/1.8/open3.rb:57:in `popen3'
示例代碼 -
require 'open3'
cmd = 'git push heroku master'
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
puts "stdout is:" + stdout.read
puts "stderr is:" + stderr.read
end
我該如何使用這款老式的紅寶石1.8寶石進行這項工作?
請發表一個工作示例。 – stack1
'IO :: popen'不會捕獲'STDERR',所以沒有辦法以同樣的方式來完成。現在,如果你想要做一些特別的事情,那麼你應該在另一個問題中提出這個問題,因爲這個問題的答案是「你不能在Windows中使用'open3'」。 – Azolo