libffi.so.6: cannot open shared object file

Asked by Tommy Pollák

After upgrade from Ubuntu 19.10 to 20.4 my Ruby on Rails applications do not work any longer.
Starting stops with error message:
/home/*usernane*/railsprojects/OTK-register/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require': libffi.so.6: cannot open shared object file: No such file or directory - /home/*username*/railsprojects/OTK-register/vendor/bundle/ruby/2.7.0/gems/ffi-1.12.2/lib/ffi_c.so (LoadError)

I have tried to uninstall ffi and do 'sudo apt-get install libffi libffi-dev' but this does not work, there is no libffi. Then 'gem install ffi' this works and installs ffi-1.12.2. But this does not help at all.

/home/*username*/railsprojects/OTK-register/vendor/bundle/ruby/2.7.0/gems/ffi-1.12.2/lib/ contains ffi_c.so but I can not find libffi.so.6 anywhere, nor libffi.so.

How can I create libffi.so.6 and where should it be? Alterantively how can I remove the dependency on libffi.so.6?

As you can see I am using Ruby 2.7.0 and Rail 6.0.2.2.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

Seems the package upgraded the library for you

https://packages.ubuntu.com/search?searchon=contents&keywords=+libffi&mode=filename&suite=focal&arch=any

If you run:

sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7 /usr/lib/x86_64-linux-gnu/libffi.so.6

Does it work OK?

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

ruby2.7 (2.7.0-5ubuntu1) from the Ubuntu repositories has a dependency on libffi.so.7 and no more libffi.so.6

From which source is your ruby installation?

Revision history for this message
Tommy Pollák (tommy.pollak) said :
#3

Thanks actionparsnip, that solved my question.

Revision history for this message
Tommy Pollák (tommy.pollak) said :
#4

To Manfred: It is old. Worked on 19.10.