jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Doesn't work with new version ruby #104

Closed andreyzltv closed 8 years ago

andreyzltv commented 8 years ago

Hello!

When I used ruby 3.0: window = RAutomation::Window.new(:title => /part of the title/i) I have an error with this message: C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inre quire': cannot load such file -- ffi_c (LoadError) from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require .rb:55:in require' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10-x86-mingw32/lib/ffi.r b:6:inrescue in <top (required)>' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10-x86-mingw32/lib/ffi.r b:3:in <top (required)>' from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require .rb:55:inrequire' from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require .rb:55:in require' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomati on/adapter/win_32.rb:6:in<top (required)>' from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require .rb:55:in require' from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require .rb:55:inrequire' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomati on/window.rb:67:in const_get' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomati on/window.rb:67:ininitialize' from test.rb:3:in new' from test.rb:3:in

'`

I installed devkit, but it did not help

When I used ruby 2.1.8: require "rautomation" window = RAutomation :: Window.new (: title => / part of the title / i) p window I had this message on the my display,and in my opinion it is true: # <RAutomation :: Window: 0x2d70a28 @ adapter =: win_32, @window = # <RAutomation :: Adapter :: Win32 :: Window: 0x26e7ee0 @container = # <RAutomation :: Window: 0x2d70a28 ...>, @ locators = {: index => 0,: title => / part of the title / i} >>

but when I wrote : p window.exists? it printed false and therefore I can not access this object. It gives an error message: C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomation-0.17.0/lib/rautomation/window.rb: 226:inrescue in wait_until_present': Window with locator {:index=>0, :title=>" text"} doesn't exist or is not visible! (RAutomation::UnknownWindowException) from C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomation-0.17.0/lib/rautomati on/window.rb:224:in wait_until_present' from C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomation-0.17.0/lib/rautomati on/window.rb:105:intitle' from test.rb:6:in <main>' what is it, I can not understand ..

jarmo commented 8 years ago

I guess you mean Ruby 2.3, because 3.0 does not exist and backtraces have hints about 2.3. The problem, as error message says, is that you can't install one of RAutomation dependencies called ffi for whatever reason. You should create an issue for them, because this is not RAutomation's problem.

If you're using 64bit Ruby, then try if it works with 32bit.

Closing this issue.