GithubHelp home page GithubHelp logo

`rescue in block in dlload': can't load D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/vendor/libui.dll (Fiddle::DLError) about libui HOT 13 CLOSED

kojix2 avatar kojix2 commented on June 4, 2024
`rescue in block in dlload': can't load D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/vendor/libui.dll (Fiddle::DLError)

from libui.

Comments (13)

kematy avatar kematy commented on June 4, 2024 1

in msys2, pacman -Syu update system
pacman -S mingw-w64-i686-libffi

then in cmd :gem install fiddle
irb(main):001:0> require 'fiddle'
=> false
irb(main):002:0> p Fiddle::VERSION
"1.0.8"
=> "1.0.8"

then

D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle.rb:67: warning: already initialized constant Fiddle::RTLD_GLOBAL
D:/Ruby25/lib/ruby/2.5.0/fiddle.rb:53: warning: previous definition of RTLD_GLOBAL was here
D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle.rb:68: warning: already initialized constant Fiddle::RTLD_LAZY
D:/Ruby25/lib/ruby/2.5.0/fiddle.rb:54: warning: previous definition of RTLD_LAZY was here
D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle.rb:69: warning: already initialized constant Fiddle::RTLD_NOW
D:/Ruby25/lib/ruby/2.5.0/fiddle.rb:55: warning: previous definition of RTLD_NOW was here
D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle.rb:61:in initialize': Exec format error (Fiddle::DLError) from D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle.rb:61:in new'
from D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle.rb:61:in dlopen' from D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle/import.rb:86:in block in dlload'
from D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle/import.rb:77:in collect' from D:/Ruby25/lib/ruby/gems/2.5.0/gems/fiddle-1.0.8/lib/fiddle/import.rb:77:in dlload'
from D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/lib/libui/ffi.rb:78:in <module:FFI>' from D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/lib/libui/ffi.rb:74:in module:LibUI'
from D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/lib/libui/ffi.rb:73:in <top (required)>' from D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/lib/libui.rb:28:in require_relative'
from D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/lib/libui.rb:28:in <module:LibUI>' from D:/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/lib/libui.rb:6:in <top (required)>'
from D:/Ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in require' from D:/Ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require'
from D:/Ruby25/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in require' from D:/ruby-lab/guis/libui.rb:1:in

'

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

At first glance, it may be a Fiddle problem.

  1. Can you call Fiddle?
require 'fiddle'
  1. If it does, what version of Fiddle do you have?
require 'fiddle'
p Fiddle::VERSION

The VERSION constant was added recently, so it may not exist. It means that it is prior to 1.0.0.

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

How did you install Ruby on Windows?
RubyInstaller?

from libui.

kematy avatar kematy commented on June 4, 2024

I install ruby with RubyInstaller.
irb(main):001:0> require 'fiddle'
=> false
gem install fiddle
Fetching: fiddle-1.0.8.gem (100%)
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-i686-libffi
错误:无法打开文件 /var/lib/pacman/local/mingw-w64-i686-gnutls-3.6.13-2/desc: No such file or directory
Building native extensions. This could take a while...

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

Thanks.

Sorry, It doesn't seem to be a fiddle problem.
It seems that libui.dll cannot be loaded. LibUI problem.

First, we need to find out if libui.dll exists.

/Ruby25/lib/ruby/gems/2.5.0/gems/libui-0.0.8/vendor/libui.dll

image
image

Check the file size and make sure the file is not corrupt.
image

from libui.

kematy avatar kematy commented on June 4, 2024

Only ofr 64 bit Ruby?
答复111

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

Only the 64bit version is packed in the Gem. (´-ω-`)
Other versions are distributed on the libui site.
If you replace it, it might work.

https://github.com/andlabs/libui/releases/tag/alpha4.1

from libui.

kematy avatar kematy commented on June 4, 2024

Thank you

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

Now I can reproduce the issue.

Ruby libui.dll work?
Ruby+Devkit 2.5.9-1 (x86) libui-alpha4.1-windows-amd64-shared.zip Not work
Ruby+Devkit 2.5.9-1 (x86) libui-alpha4.1-windows-386-shared.zip OK

Thank you for your report.
If there are no further problems, please close it.

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

Updates
Added a task to the Rakefile to download the 32-bit libui shared library.

rake vendor:all_x64      # Download libui.so, libui.dylib, and libui.dll to...
rake vendor:linux_x64    # Download libui.so for Linux to vendor directory
rake vendor:linux_x86    # Download libui.so for Linux to vendor directory
rake vendor:mac_x64      # Download libui.dylib for Mac to vendor directory
rake vendor:windows_x64  # Download libui.dll for Windows to vendor directory
rake vendor:windows_x86  # Download libui.dll for Windows to vendor directory

So, you can install it as follows

rake vendor:windows_x86
rake install

from libui.

rubyFeedback avatar rubyFeedback commented on June 4, 2024

Oddly enough I re-installed the Win10 laptop and I ran into the exact same issue.

The strange thing is that prior to the re-installation, that issue did not happen.

Right now I am a bit confused how this error shows up. I don't recall what I did
different prior to the reinstall; always installed via "gem install libui".

Note that require 'fiddle' and Fiddle::VERSION works. But require 'libui' fails
with a "No such file or directory" Fiddle::DLError.

Is there some path issue perhaps? I can start "irb" from cmd.exe just fine
and "ruby -v" shows the most recent ruby version (which is ruby 3.0.3).

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

@rubyFeedback
Please tell us a little more about your environment.
Did you use RubyInstaller to install Ruby, and is Ruby really a 64-bit version?
Obviously using a 32bit version of Ruby will cause problems, but other causes are less clear and need to be investigated.

from libui.

kojix2 avatar kojix2 commented on June 4, 2024

One way to tell 64bit Ruby from 32bit Ruby is to use
ruby -e "puts 1.size"

If it is 4, it is 32-bit, and if it is 8, it is 64-bit.

from libui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.