leviwilson / mohawk

MIT License
14 stars 8 forks source link

Mohawk with uia 0.6 #14

Closed rs-mphasis closed 5 years ago

rs-mphasis commented 5 years ago

Hi leviwilson, Could you please facilitate an updated version of mohawk - with uia 0.6 as the dependency? Reason: mohawk 0.4.3, is currently dependent on uia 0.5 - which doesn't seem to work (for me) on Win 10 using ruby 2.4.x/2.5.x (32 bit).

Potential root cause: uia 0.5 being locked to ffi 1.9.0.

Error Observed: cannot load such file -- ffi_c (LoadError) C:/Ruby25/lib/ruby/gems/2.5.0/gems/ffi-1.9.0-x86-mingw32/lib/ffi.rb:14:in require' C:/Ruby25/lib/ruby/gems/2.5.0/gems/ffi-1.9.0-x86-mingw32/lib/ffi.rb:14:inrescue in <top (required)>' C:/Ruby25/lib/ruby/gems/2.5.0/gems/ffi-1.9.0-x86-mingw32/lib/ffi.rb:3:in `<top (required)>'

P.S. uia 0.6 works fine.

Kindly assist. Thank You!

leviwilson commented 5 years ago

You can just bundle update uia or specify that version in your project, correct?

rs-mphasis commented 5 years ago

Hi leviwilson I attempted the following options: 1) Add gem uia, '0.6' in project Gemfile Project Reference: https://github.com/Reppinger/mohawk_example Error Observed: Could not require C:/Ruby25/lib/ruby/gems/2.5.0/gems/mohawk-0.4.3/lib/mohawk/adapters/uia/button.rb (uninitialized constant Mohawk::Adapters::UIA::Control). Please require the necessary files (RequireAll::LoadError)

2) Built and used - custom version of gem Mohawk, as follows: a) Cloned the mohawk project (https://github.com/leviwilson/mohawk.git) b) updated the gemspec file to use uia 0.6 c) executed rake build and copied the resulting gem from pkg\mohawk-0.4.3.gem to local drive d) Updated project Gemfile with - gem 'mohawk' , '0.4.3' , :path => 'local\drive' Observation: require 'mohawk' seems to error out as follows - Could not require C:/Ruby25/lib/ruby/gems/2.5.0/gems/mohawk-0.4.3/lib/mohawk/adapters/uia/button.rb (uninitialized constant Mohawk::Adapters::UIA::Control). Please require the necessary files (RequireAll::LoadError)

I am not sure if I'm missing something and hence the request via this issue please. Kindly suggest. Thanks!

leviwilson commented 5 years ago

Setting the mohawk.gemspec file to gem.add_dependency 'uia', '~> 0.5 just says that it has to at least be uia version 0.5.

There's nothing stopping you from using uia version 0.6 in your project so I might be missing where you problem might be.

If you can checkin a project that you're working on that is not working I can take a look.

rs-mphasis commented 5 years ago

Hi leviwilson, Seems like the root cause of LoadError is 'require_all' gem v 2.0.0. I validated using v 1.5.0 of 'require_all' and ran into the '[BUG] Segmentation fault' issue (resolution to which is described in wiki of uia gem).

To conclude, I had to downgrade to ruby 2.4.5 to work with ffi 1.9.18 (to resolve Segmentation fault). Below updates to Gemfile work fine for me now.

gem 'mohawk' gem 'uia', '0.6' gem 'ffi', '1.9.18' gem 'require_all' , '1.5.0'

Thank You for your time and support!