# Ruby and Gnuplot under Windows (was: Re: External applicatio

**URL:** <https://www.ruby-forum.com/t/ruby-and-gnuplot-under-windows-was-re-external-applicatio/62649>\
**Category:** Ruby\
**Created:** [June 7, 2006, 12:07am UTC](https://www.ruby-forum.com/t/ruby-and-gnuplot-under-windows-was-re-external-applicatio/62649 "2006-06-07T00:07:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 7, 2006, 12:07am UTC](https://www.ruby-forum.com/t/ruby-and-gnuplot-under-windows-was-re-external-applicatio/62649/1 "2006-06-07T00:07:22Z")

</div>

Dear Chris,

thanks for pointing me to ruby gnuplot. However, I need to  
set up a connection under Windows XP (in addition to one  
in Linux).  
Now, in the manual of Ruby Gnuplot,  
it says:

Gnuplot.open  
Instantiates a new Gnuplot process. The path to the executable is  
determined  
on a Unix or MacOSX system using the which command. Windows users, I  
have no  
idea what to do. If a block is given to the function the opened process  
is  
passed into the block. This mimics the most common usage of the  
File.open  
method.

I want to combine Gnuplot support to an FXRuby application, and  
unfortunately,  
this always crashes with Segfault when I run it in Cygwin, which used to  
be  
my way of running Ruby and indeed anything on Windows…  
So I tried to install the ruby gnuplot gem (v 2.2) using the gem  
installer  
of the one-click  
installer, and tried this test file:

require ‘rubygems’  
require ‘gnuplot’

Gnuplot.open do |gp|  
Gnuplot::Plot.new( gp ) do |plot|

plot.xrange “[-10:10]”  
plot.title “Sin Wave Example”  
plot.ylabel “x”  
plot.xlabel “sin(x)”

plot.data \<\< Gnuplot::DataSet.new( “sin(x)” ) do |ds|  
ds.with = “lines”  
ds.linewidth = 4  
end

end

end

Now, the application starts, but just doesn’t do anything - there is  
no error message or warning, and no output.  
Does anybody use Ruby Gnuplot and the Ruby from the one-click  
installer (latest version) successfully ?

Thanks,

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 7, 2006, 12:25am UTC](https://www.ruby-forum.com/t/ruby-and-gnuplot-under-windows-was-re-external-applicatio/62649/2 "2006-06-07T00:25:48Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Gnuplot.open  
> Instantiates a new Gnuplot process. The path to the executable is determined  
> on a Unix or MacOSX system using the which command. Windows users, I have no  
> idea what to do. If a block is given to the function the opened process is  
> passed into the block. This mimics the most common usage of the File.open  
> method.

Note to author of Gnuplot.open: use File.which, from the ptools  
package. It’s cross platform.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 7, 2006, 12:41am UTC](https://www.ruby-forum.com/t/ruby-and-gnuplot-under-windows-was-re-external-applicatio/62649/3 "2006-06-07T00:41:14Z")

</div>

On Wed, 7 Jun 2006, Daniel B. wrote:

> > the function the opened process is passed into the block. This mimics the  
> > most common usage of the File.open method.

> Note to author of Gnuplot.open: use File.which, from the ptools package.  
> It’s cross platform.

but doesn’t seem to be in my ruby? where are you getting it?

-a

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 7, 2006, 12:53am UTC](https://www.ruby-forum.com/t/ruby-and-gnuplot-under-windows-was-re-external-applicatio/62649/4 "2006-06-07T00:53:57Z")

</div>

On Wed, 7 Jun 2006, Daniel B. wrote:

> gem install ptools 🙂

jib:~ \> ruby -W0 -e’ require “rubygems”; require “ptools”; p  
File.which(“ls”); ’  
“/bin/ls”

very cool. thanks!

-a

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [June 7, 2006, 12:44am UTC](https://www.ruby-forum.com/t/ruby-and-gnuplot-under-windows-was-re-external-applicatio/62649/5 "2006-06-07T00:44:32Z")

</div>

removed\_email\_address@domain.invalid wrote:

> > > executable is determined on a Unix or MacOSX system using the which  
> > > -a  
> > > gem install ptools 🙂

I _thought_ FileUtils had a ‘which’ equivalent, but I guess I was  
mistaken.

Regards,

Dan
