Forum: JRuby Uninitialized Constant WIN32OLE

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.
10f203a59db29cd7eb727b8ff11e7b76?d=identicon&s=25 Rag Nar (augustus)
on 2016-03-24 09:02
I am trying to use WIN32OLE gem available in jar file; build according
to
Nick's blog:
http://blog.nicksieger.com/articles/2009/01/10/jru...

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:

wsh=WIN32OLE.new('Wscript.shell')

getting uninitialized constant error.

I am new to JRuby scripting. Just banging my head from last couple to
days.
0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2016-03-30 14:54
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
http://www.fusshuhn.de/jruby_bridge_tutorial/gems.html.

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 topic is locked and can not be replied to.