ruby-vips: Windows problem (ffi-based ruby-vips)
In order to keep https://github.com/jcupitt/ruby-vips/issues/115 clean, I decided to open a new issue for Windows support.
Install instructions for Windows x64:
- Install Ruby using the RubyInstaller.
- Set the
RUBY_DLL_PATHenvironment variable to libvips bin directory. - Clone the FFI branch with
git clone -b ffi-experiment https://github.com/jcupitt/ruby-vips.git - Install ruby-vips:
cd ruby-vips gem install bundler bundle install bundle exec rake install - Apply this patch (my attempt to load the DLL files).
- Run a example:
cd example trim8.rb image.png image2.png
You’ll see this error:
(LoadError)4/lib/ruby/gems/2.4.0/gems/ffi-1.9.18-x64-mingw32/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open library 'libvips-42.dll': The specified procedure could not be found.
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ffi-1.9.18-x64-mingw32/lib/ffi/library.rb:100:in `map'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ffi-1.9.18-x64-mingw32/lib/ffi/library.rb:100:in `ffi_lib'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-vips-2.0.0/lib/vips.rb:356:in `<module:Vips>'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-vips-2.0.0/lib/vips.rb:353:in `<top (required)>'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from C:/ruby-vips/example/trim8.rb:10:in `<main>'
Tested on 2 different Windows 10 64-bits computer’s, unfortunately the error persists. I’ve opened libvips-42.dll in Dependency Walker to see if I missed some dependencies, but all seems to be ok.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (19 by maintainers)
Commits related to this issue
- load DLLs on Windows see https://github.com/jcupitt/ruby-vips/issues/118 — committed to libvips/ruby-vips by jcupitt 7 years ago
- load DLLs on Windows see https://github.com/jcupitt/ruby-vips/issues/118 — committed to oleksandrbyk/olek-ruby-vips by oleksandrbyk 7 years ago
Good job Kleis! I’ll apply that fix (I’d never heard of :force) and I think we can release 2.0.
omg
/me falls off his chair
I’ve just tested out https://github.com/jcupitt/ruby-vips/commit/17d42c9f5c497186210fe7b9d0148f54da220ff1.
With
typedef :ulong, :GTypehere I still get this error:Changing it to
typedef :uint64, :GType, then everything seems to work fine on Windows x64 (runningtrim8.rb image.png image2.pngwill successfully trim the image). 🎉I didn’t test it out on a 32-bit Windows PC, but I think it will need
typedef :uint32, :GType(just like lua-vips and pyvips).