Uninitialized Constant WIN32OLE

I am trying to use WIN32OLE gem available in jar file; build according
Nick’s blog:

I added the path of the jar file at top of the script like:
require ‘C:/…/win32ole-gem.jar’

but, when I am trying to create an object variable for Wscript.shell:


getting uninitialized constant error.

I am new to JRuby scripting. Just banging my head from last couple to

May I ask you, where on Nick’s blog you find the suggestion for writing
the require statement in the way you did? Maybe this is supposed to work
too; I just can’t see it from this blog.

I have also used this page as an inspiration on how to put the gems in
the jar. You can find it, though in a somewhat terse way, in

The basic idea is to put it into the Jar file, but you still use, say,

 require 'win32ole'

from within your application. This makes sense, because the source code
of your application should be independent from the location of the Gems
(inside a Jar, or within the file system).

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs