You are not logged in.

#1 2020-04-18 19:22:10

Sourav
Member
From: India
Registered: 2019-04-22
Posts: 84
Website

rake libffi.so.6: cannot open shared object file

After upgrading my system, I can't run rails, and most importantly, not rake.

rake says:

$ rake
rake aborted!
LoadError: libffi.so.6: cannot open shared object file: No such file or directory - /usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/ffi_c.so
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `<main>'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `<main>'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
/home/sourav/railsProjects/DevcampPortfolio/config/application.rb:20:in `<top (required)>'
/home/sourav/railsProjects/DevcampPortfolio/Rakefile:4:in `require_relative'
/home/sourav/railsProjects/DevcampPortfolio/Rakefile:4:in `<top (required)>'
/home/sourav/.gem/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'

Caused by:
LoadError: cannot load such file -- 2.7/ffi_c
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `<main>'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `<main>'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/sourav/.gem/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
/home/sourav/.gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
/home/sourav/railsProjects/DevcampPortfolio/config/application.rb:20:in `<top (required)>'
/home/sourav/railsProjects/DevcampPortfolio/Rakefile:4:in `require_relative'
/home/sourav/railsProjects/DevcampPortfolio/Rakefile:4:in `<top (required)>'
/home/sourav/.gem/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'

Caused by:
Bootsnap::LoadPathCache::FallbackScan: 

(See full trace by running task with --trace)

Version:

core/libffi 3.3-3

Temporary fix:

ln -s /usr/lib/libffi.so.7 /usr/lib/libffi.so.6

But according to WorMzy, this is a "stupid" idea https://bbs.archlinux.org/viewtopic.php?id=254650

Nothing is posted on https://www.archlinux.org relating to this error.

Many bug reports were launched but closed:
FS#66219 - [meld] libffi.so.6: cannot open shared object file
FS#66293 - [vim, xorg] "Missing libffi6" after upgrade
FS#66230 - Recent Libffi upgrade has crashed Blender

Another one from github:
Pipenv install fails with "cannot open shared object libffi.so.6" #4194

How do I fix the error?

Last edited by Sourav (2020-04-18 20:07:05)

Offline

#2 2020-04-18 19:44:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,159
Website

Re: rake libffi.so.6: cannot open shared object file

You need to update your locally installed gems.

EDIT: it seems upstream gems need to be updated / rebuilt first, you'll need to A) switch to the arch packages, B) rebuild them yourself, or C) contact upstream ruby to get them to rebuild.

Last edited by Trilby (2020-04-18 19:47:05)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-04-18 19:45:26

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: rake libffi.so.6: cannot open shared object file

By rebuilding the ruby gems that linked against libffi.so.6.
Arch package maintainers are responsible for updating arch supplied packages on library updates.  Packages not supplied by arch are the users responsibility to maintain.
Edit:
Why are you not using ruby-rake from the community repository?
Edit2:
ruby-activesupport is also in community.

Last edited by loqs (2020-04-18 19:55:29)

Offline

#4 2020-04-18 19:56:45

Sourav
Member
From: India
Registered: 2019-04-22
Posts: 84
Website

Re: rake libffi.so.6: cannot open shared object file

Hello! The ruby rake was installed locally with the gem command. Uninstalling the rake gem will remove 63 other of ruby gems from my system.

However, now I installed ruby-rake with pacman. According to pacman -Ql, it provides the executable to /usr/bin/rake

Executing /usr/bin/rake also shows the same error.

Edit: According to https://wiki.archlinux.org/index.php/Ru … stallation

Rails should be installed with:

gem install rails

I have removed all the gems (terrible idea) and installed rake and rails. Rails still fetches rake from rubygems.org. After running rake, it  doesn't use the repository activesupport.

Last edited by Sourav (2020-04-18 20:30:55)

Offline

#5 2020-04-18 20:17:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,159
Website

Re: rake libffi.so.6: cannot open shared object file

Rake actually isn't that relevant it seems, it's ruby itself.  If you are using the system-wide ruby, you'd be fine, it has been rebuilt.

Ruby in the repos is 2.7.1, your local version is 2.7.0

Last edited by Trilby (2020-04-18 20:19:55)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2020-04-18 20:27:53

Sourav
Member
From: India
Registered: 2019-04-22
Posts: 84
Website

Re: rake libffi.so.6: cannot open shared object file

Trilby wrote:

Ruby in the repos is 2.7.1, your local version is 2.7.0

Actually I am using:

pacman -Qs ^ruby$
local/ruby 2.7.1-2
    An object-oriented language for quick and easy programming

It says Ruby 2.7.0 is because ruby gems likes to use the major.minor.0 format for the folder. For example, If I use Ruby 2.6.5 ruby gems will be loaded from 2.6.0.

Last edited by Sourav (2020-04-18 20:30:21)

Offline

#7 2020-04-18 20:33:54

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: rake libffi.so.6: cannot open shared object file

Have you rebuilt ffi 1.12.2 for libffi.so.7?

Offline

#8 2020-04-18 21:49:33

Sourav
Member
From: India
Registered: 2019-04-22
Posts: 84
Website

Re: rake libffi.so.6: cannot open shared object file

Nope, for the time being, symbolic link is working fine!

Offline

#9 2020-04-18 21:51:36

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: rake libffi.so.6: cannot open shared object file

Offline

#10 2020-04-18 21:52:23

Sourav
Member
From: India
Registered: 2019-04-22
Posts: 84
Website

Re: rake libffi.so.6: cannot open shared object file

Installing the package ruby-ffi solves this issue. I had to overwrite the existing files though:

pacman -S --overwrite '*' ruby-ffi

Offline

#11 2020-04-18 21:58:26

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: rake libffi.so.6: cannot open shared object file

Why would you need to overwrite anything to install ruby-ffi unless you had been installing ruby gems globally using something other than pacman?

Offline

#12 2020-04-18 22:28:33

Sourav
Member
From: India
Registered: 2019-04-22
Posts: 84
Website

Re: rake libffi.so.6: cannot open shared object file

Sorry I had messed up. I had ffi installed as root user (with gem) and then used pacman and overwritten the files, which works but not a recommended way of getting things done, but a clean reinstallation of ffi using gem command works as well.

Offline

#13 2020-04-18 22:41:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,159
Website

Re: rake libffi.so.6: cannot open shared object file

Sourav wrote:

I had ffi installed as root user (with gem) and then used pacman and overwritten the files, which works but not a recommended way of getting things done, but a clean reinstallation of ffi using gem command works as well.

*headdesk*

I beleive you have completely reversed what is recommended and what is not.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#14 2020-04-18 22:57:36

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: rake libffi.so.6: cannot open shared object file

Sourav wrote:

but a clean reinstallation of ffi using gem command works as well.

And will break your system again next time any of it's dependencies get a soname bump...


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#15 2020-04-19 06:03:09

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: rake libffi.so.6: cannot open shared object file

Why exactly is this supposed to be rocket science, any of this?

Sourav wrote:

After upgrading my system, I can't run rails, and most importantly, not rake.

rake says:

$ rake
rake aborted!
LoadError: libffi.so.6: cannot open shared object file: No such file or directory - /usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/ffi_c.so
[...]

This file which breaks rake with a LoadError, is broken and needs to be relinked with the system libffi. As stated in your initial error message.

$ pkgfile -vr /usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/ffi_c.so
community/ruby-ffi 1.12.2-2	/usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/ffi_c.so

WHY ARE YOU NOT USING THE PACMAN PACKAGE WHICH WAS CORRECTLY REBUILT??? If you were using the pacman package, this file would report:

$ readelf -d /usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/ffi_c.so
 0x0000000000000001 (NEEDED)             Shared library: [libffi.so.7]

lo and behold, it is not linked to libffi.so.6

Unless you do broken things like "sudo gem install XXX"

Because these are all brain-dead bug reports, nothing is broken except for what the user deliberately broke, and why on earth should we post a news bulletin to all arch users for every stupid thing a user might do?

DO NOT INSTALL GEMS WITH SUDO.

Thank you.

If you are ever getting a missing shared library error, you are almost certainly doing something wrong yourself, which can be fixed by removing whatever you installed without using pacman, or rebuilding your stale AUR packages.

The remaining cases are when pyenv downloads the python source code and compiles it in your $HOME because I-don't-even-know-why-you-want-this (and you must rebuild all your custom software in $HOME), or...

when there is a bug in an archlinux package which can be proved by proving that an archlinux package contains a file which "readelf -d" (but not ldd, ldd is trash) reports to be linked against the problematic shared library.

If your error message talks about a file, let's say that file is /usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/ffi_c.so, and pacman -Qo /usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.2/ffi_c.so reports "error: No package owns ...", then it is definitively not an arch bug and doesn't need an Arch News post.

If you think that there's any good excuse to ever use 'sudo gem' ever, under any circumstances ever, then you are wrong. /usr belongs to pacman.

If you think that anyone in a position of authority suggests it's a bad idea to use pacman for your gems, you are wrong as well. (Random people on the internet may say it, but that just means both you and they are wrong.)

If you think that somehow, after reading the archwiki documentation for ruby on rails which tells you to install it without root, then tells you "while it is possible to do it as root, read this article on the possible dangers, and therefore don't do it"... you still come to the conclusion that you should, in fact, do it... then you are wrong yet again.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB