Ruby-sikuli setup with Mac

Asked by dinesh

Hello,

I am getting an error as "Make sure SIKULIXAPI_JAR is set! (LoadError)" while running a script in Mac with Ruby

My set up is:

(i) Downloaded the sikulixsetup-1.1.0.jar file and installed.
(ii) Used export sikulixapi_jar=/Applications/sikulixapi.jar.
(ii) Did gem install sikulix
(iv) Installed Jruby

Ref: https://github.com/chaslemley/sikuli_ruby

In the script level, I passed the value as 'Require 'sikulix'

Can anyone help me out to setup the sikulix on Mac with Ruby.

I need this urgently...

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Used export sikulixapi_jar=/Applications/sikulixapi.jar.

I guess it must be:

export SIKULIXAPI_JAR=/Applications/sikulixapi.jar

Revision history for this message
dinesh (dperomy) said :
#2

I have used the same command in the terminal, but still getting the following error...

Failed to load
Make sure SIKULIXAPI_JAR is set! (LoadError)
/Users/xxxxx/.rvm/gems/ruby-2.2.3/gems/sikulix-1.1.0.3/lib/sikulix/platform.rb:13:in `rescue in check_and_require'
/Users/xxxx/.rvm/gems/ruby-2.2.3/gems/sikulix-1.1.0.3/lib/sikulix/platform.rb:6:in `check_and_require'
/Users/xxx/.rvm/gems/ruby-2.2.3/gems/sikulix-1.1.0.3/lib/sikulix.rb:2:in `<top (required)>'
/Users/xxxx/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/Users/xxxx/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/Users/xxxx/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/xxxx/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/Users/xxxx/Desktop/Test_BDD/features/support/Env.rb:27:in `<top (required)>'
/Users/xxxxx/.rvm/gems/ruby-2.2.3/gems/cucumber-1.3.20/lib/cucumber/rb_support/rb_language.rb:95:in `load'
/Users/xxxx/.rvm/gems/ruby-2.2.3/gems/cucumber-1.3.20/lib/cucumber/rb_support/rb_language.rb:95:in `load_code_file'
/Users/xxxx/.rvm/gems/ruby-2.2.3/gems/cucumber-1.3.20/lib/cucumber/runtime/support_code.rb:180:in `load_file'
/Users/xxxxxs/.rvm/gems/ruby-2.2.3/gems/cucumber-1.3.20/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/xxxxx/.rvm/gems/ruby-2.2.3/bin/cucumber:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'

Revision history for this message
RaiMan (raimund-hocke) said :
#3

I have no idea, since I am not really familiar with this gem stuff.

If you tell me more about what your intention is, may be I can help you better.

Revision history for this message
dinesh (dperomy) said :
#4

OK - I will try and provide everything. We use a Watir-Cucumber setup and would like to use sikuli to test a flash-flex web app. We have already successfully trailed this on a Java selenium framework, but we need this to work with our established Watir-cucumber setup.

I am getting this error right at the beginning of trying to compile - so can't even get to scripting, so I guess the ultimate intention is to compile Sikuli. It's probably not relevant, but our IDE is RubyMine.

Revision history for this message
dinesh (dperomy) said :
#5

It appears to be this that is causing the issue. If I try and hard code the value for sikulix_path I get a different error - 'cannot load such file'

 # check external jar
        sikulix_path = (ENV['SIKULIXAPI_JAR']|| ENV['SIKULIX_HOME'] || "").chomp(' ')
        unless File.exist? sikulix_path
          raise LoadError, "Failed to load #{sikulix_path}\nMake sure SIKULIXAPI_JAR is set!"
        end

Revision history for this message
RaiMan (raimund-hocke) said :
#6

I do not understand, why you need the gem stuff.

beneath your Watir/Cucumber environment you have some Ruby layer, that implements the Cucumber stuff.
In this Ruby context you want to utilize Sikuli features.

So take care, that you work with JRuby at the Ruby level, put sikulixapi.jar on the Java class path and say require/include at the JRuby level.

Can you help with this problem?

Provide an answer of your own, or ask dinesh for more information if necessary.

To post a message you must log in.