Using the win32api

Hi all,

I'm trying to use the win32api, in the Sketchup ruby API. then loading
the package with

require "win32api"

I get the following error :

no such file to load -- win32api

I'm using this page as a reference :
http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_windows.html.

Am I doing something wrong ? do I need to install a gem before using the
api ?

I'm on windows with ruby 1.8.6, installed via the windows binary
package. I think it might be a problem with the ruby paths.

I have search for a file called win32api in the ruby installation
directory, there is a .so file, but no .rb file.

Thanks,

Futar

···

--
Posted via http://www.ruby-forum.com/.

SketchUp provides it's own version of Ruby that you can't replace or
mix with a another installation.

win32api is a Ruby C-extension and its file extension is ".so" so that
part is correct, you will find it on any installation of
RubyInstaller.

However, if that file is missing from sketchup, you could try placing
in the valid Ruby paths of the tool, but I recommend not to, specially
since things could explode on your face.

AFAIK SketchUp uses an old version of Ruby and RubyInstaller has been
provided for modern versions, mixing them could lead to issues.

···

On Apr 18, 8:13 am, antoine crouzi <bouri...@yopmail.com> wrote:

Hi all,

I'm trying to use the win32api, in the Sketchup ruby API. then loading
the package with

require "win32api"

I get the following error :

no such file to load -- win32api

I'm using this page as a reference :Programming Ruby: The Pragmatic Programmer's Guide.

Am I doing something wrong ? do I need to install a gem before using the
api ?

I'm on windows with ruby 1.8.6, installed via the windows binary
package. I think it might be a problem with the ruby paths.

I have search for a file called win32api in the ruby installation
directory, there is a .so file, but no .rb file.

--
Luis Lavena

re,

interestingly enough, if I copy the win32api.so in the plugin directory,
I've got a different error :

127: La procédure spécifiée est introuvable. - Init_win32api

[127: The specified procedure could not be found. - Init_win32api]

any ideas to make it work ?

···

--
Posted via http://www.ruby-forum.com/.

solution : require 'Win32API' :slight_smile:

···

--
Posted via http://www.ruby-forum.com/.

Daer, Mr.David Willey;

Mr. David I dont know what can i do ? I have Ruby on rails V 1.7.2 , and my friend referencing for me using Win32 Ole and then i find your list.

Date: Tue, 19 Apr 2011 05:40:33 +0900
From: luislavena@gmail.com
Subject: Re: Using the win32api
To: ruby-talk@ruby-lang.org

> Hi all,
>
> I'm trying to use the win32api, in the Sketchup ruby API. then loading
> the package with
>
> require "win32api"
>
> I get the following error :
>
> no such file to load -- win32api
>
> I'm using this page as a reference :Programming Ruby: The Pragmatic Programmer's Guide.
>
> Am I doing something wrong ? do I need to install a gem before using the
> api ?
>
> I'm on windows with ruby 1.8.6, installed via the windows binary
> package. I think it might be a problem with the ruby paths.
>
> I have search for a file called win32api in the ruby installation
> directory, there is a .so file, but no .rb file.
>

SketchUp provides it's own version of Ruby that you can't replace or
mix with a another installation.

win32api is a Ruby C-extension and its file extension is ".so" so that
part is correct, you will find it on any installation of
RubyInstaller.

However, if that file is missing from sketchup, you could try placing
in the valid Ruby paths of the tool, but I recommend not to, specially
since things could explode on your face.

AFAIK SketchUp uses an old version of Ruby and RubyInstaller has been
provided for modern versions, mixing them could lead to issues.

--
Luis Lavena

My Nane : Cici WirachmatSignature powered by WiseStamp

···

On Apr 18, 8:13 am, antoine crouzi <bouri...@yopmail.com> wrote: