ruby/fiddle

Could not require Fiddle in ruby.

jewel-snake opened this issue · 2 comments

when I try to require fiddle
irb -U -r fiddle
it says:
/home/kun/.rvm/gems/ruby-2.7.0/gems/irb-1.2.3/lib/irb/init.rb:290: warning: LoadError: libffi.so.6: cannot open shared object file: No such file or directory - /home/kun/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/x86_64-linux/fiddle.so
to deal with it, I tried to downgrade libffi version from 3.3.3 to 3.2.1 and from the first view it looked ok, but my visual code stopped working and was reporting similar issue.
my system parameters:
OS : Arch Linux 5.6.4
Ruby : 2.7.0, with rvm
Libffi : 3.3.3
Fiddle gem : 1.0.0

kou commented

It seems that libffi 3.2.1 provides libffi.so.6 but libffi 3.3.3 provides libffi.so.7.
Could you rebuild Ruby and try again?

Normally, you don't need to rebuild Ruby. You just reinstall fiddle gem. But there is a bug in fiddle gem. You need to rebuild Ruby to use libffi.so.7.

This is fixed in the next version.

executing
rvm reinstall ruby-2.7.0
solved the problem, thank you.