Ruby 1.9 - 没有这样的文件加载'win32/open3'

Aar*_*nes 6 ruby

我正在Windows上运行ruby 1.9.2并试图移植在Ruby 1.8中运行的代码.该代码使用Open4.popen4,以前工作正常.在1.9.2中,我做了以下工作:

  1. 通过安装POpen4 gem install POpen4
  2. 需要POpen4通过 require 'popen4'
  3. 尝试使用POpen4,如: Open4.popen4("cmd") {|io_in,io_out,io_er| ... }

当我这样做时,我收到错误: no such file to load -- win32/open3

如果我尝试安装win32-open3(gem install win32-open3),我会收到错误消息:
win32-open3 requires Ruby version < 1.9.0

有谁知道我是如何解决这个问题的?

Ste*_*elm 14

没用过,但这可能有用:https://github.com/matschaffer/win32-open3-19

  • 为我工作.添加到Gemfile gem"win32-open3-19",:platforms =>:mingw,:git =>"https://github.com/matschaffer/win32-open3-19.git" (2认同)