Help Getting Echanter to work for Ruby

24 views
Skip to first unread message

jeromewoody

unread,
Jun 14, 2010, 7:38:14 PM6/14/10
to enchanter-users
Hello:

I'm trying to get Enchanter to work using ruby. I've loaded up .jars
from this project, from Jruby and from ganymed into my classpath,
along with trying to get an extremely simple script to work, and I'm
not having any success. Below is my classpath and the code I wrote:

--Classpath

.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\java_classes
\enchanter-core-0
.5.1.jar;C:\java_classes\enchanter-ruby-0.5.1.jar;C:\java_classes
\jruby-complete
-1.5.1.jar;C:\java_classes\ganymed-ssh2-build210.jar

-- Ruby Script

require "java"
require "uwm_config.rb"
include_class "org.twdata.enchanter.SSH"


$conn = SSH.new();
#Attributes in connect() come from config file
$conn.connect(SSHHOST,22,SSHUSERNAME,SSHPASSWORD);


I ran this at the command prompt

java -jar c:\java_classes\enchanter-ruby-0.5.1.jar myscript.rb

and this is what I got in response:

UWMillenium.rb:10:in `method_missing': undefined method `connect' for
#<SSH:0x15
aed57 @java_object=$Proxy0> (NoMethodError)
from myscript.rb:10
from :-1

Also, I'm having trouble getting Learning mode to generate a script
from an interactive session. It connect to the computer I want to
automate fine, but it never creates the code from my session. Anyway,
I like the idea of this, enough to tell my team to not consider
Expect4j for the project we are doing, but these fundamental problems
are slowing me done. Any help would be greatly appeciated.
Reply all
Reply to author
Forward
0 new messages