Ruby 1.9 - 没有加载“win32/open3"的文件 [英] Ruby 1.9 - no such file to load 'win32/open3'

查看:31
本文介绍了Ruby 1.9 - 没有加载“win32/open3"的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 上运行 ruby​​ 1.9.2 并且正在尝试移植在 Ruby 1.8 中工作的代码.该代码使用以前运行良好的 Open4.popen4.在 1.9.2 中,我完成了以下操作:

I'm running ruby 1.9.2 on Windows and am trying to port code that worked in Ruby 1.8. The code uses Open4.popen4 which previously worked fine. With 1.9.2 I have done the following:

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

当我这样做时,我收到错误:没有要加载的文件 -- win32/open3

When I do, I get the error: no such file to load -- win32/open3

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

If I try and install win32-open3 (gem install win32-open3) I get the error:
win32-open3 requires Ruby version < 1.9.0

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

Does anyone know how I get around this problem?

推荐答案

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

Haven't used it, but this might work: https://github.com/matschaffer/win32-open3-19

这篇关于Ruby 1.9 - 没有加载“win32/open3"的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆