Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby 1.9 - no such file to load 'win32/open3'

Tags:

ruby

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. 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| ... }

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

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?

like image 267
Aaron Janes Avatar asked Feb 08 '11 06:02

Aaron Janes


2 Answers

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

like image 62
Steve Wilhelm Avatar answered Nov 03 '22 11:11

Steve Wilhelm


Adding

gem "win32-open3-19", :platforms => :mingw, :git => "github.com/matschaffer/win32-open3-19.git"

to my Gemfile didn't exactly work.

Here are the steps that solved this for me:

  1. Add this to the Gemfile -> gem 'win32-open3-19', :platforms => :mingw
  2. Run bundle to install win32-open3-19

That was it. For me the git location was unncessary and didn't work.

like image 3
Eat at Joes Avatar answered Nov 03 '22 12:11

Eat at Joes