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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67bb4df2775f6a6b603347dce7119571?d=identicon&s=25 unknown (Guest)
on 2006-06-07 00:07
(Received via mailing list)
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
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (Guest)
on 2006-06-07 00:25
(Received via mailing list)
Nuralanur@aol.com 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
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-06-07 00:41
(Received via mailing list)
On Wed, 7 Jun 2006, Daniel Berger 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
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (Guest)
on 2006-06-07 00:44
(Received via mailing list)
ara.t.howard@noaa.gov 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
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-06-07 00:53
(Received via mailing list)
On Wed, 7 Jun 2006, Daniel Berger wrote:

> gem install ptools :)

   jib:~ > ruby -W0 -e' require "rubygems"; require "ptools"; p
File.which("ls"); '
   "/bin/ls"

very cool.  thanks!

-a
This topic is locked and can not be replied to.