You are not logged in.

#1 2020-05-22 14:06:16

Bamarin
Member
From: Sweden
Registered: 2019-12-22
Posts: 9
Website

[SOLVED] bundler: failed to load command: jekyll

First of all, hello everyone! This is one of my first posts so forgive me if I won't depict an accurate image of the situation.

I'm using Jekyll for a website hosted on GithubPages. I was trying to run the site locally like I used to do in the beginning to avoid pushing a lot of commit while testing new stuff.
The command I used is `bundle exec jekyll` but like I said I haven't used it for a while so I don't know when it stopped working.

$ bundle exec jekyll serve

bundler: failed to load command: jekyll (~/.gem/ruby/2.7.0/bin/jekyll)
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.1/ffi_c.so
  /usr/lib/ruby/gems/2.7.0/gems/ffi-1.12.1/lib/ffi.rb:6:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/ffi-1.12.1/lib/ffi.rb:6:in `rescue in <top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/ffi-1.12.1/lib/ffi.rb:3:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `require_relative'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll/converters/scss.rb:3:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll-sass-converter.rb:4:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/lib/jekyll.rb:206:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/lib/jekyll.rb:206:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/exe/jekyll:8:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/exe/jekyll:8:in `<top (required)>'
  ~/gem/ruby/2.7.0/bin/jekyll:23:in `load'
  ~/gem/ruby/2.7.0/bin/jekyll:23:in `<top (required)>'

$ jekyll

Traceback (most recent call last):
    10: from ~/.gem/ruby/2.7.0/bin/jekyll:23:in `<main>'
     9: from ~/.gem/ruby/2.7.0/bin/jekyll:23:in `load'
     8: from ~/.gem/ruby/2.7.0/gems/jekyll-4.0.1/exe/jekyll:11:in `<top (required)>'
     7: from ~/.gem/ruby/2.7.0/gems/jekyll-4.0.1/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
     6: from ~/gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
     5: from ~/gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:26:in `setup'
     4: from ~/gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:26:in `map'
     3: from ~/gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
     2: from ~/gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
     1: from ~/gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:31:in `block in setup'
~/gem/ruby/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:312:in `check_for_activated_spec!': You have already activated public_suffix 4.0.5, but your Gemfile requires public_suffix 4.0.3. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

Last edited by Bamarin (2020-05-22 20:44:40)

Offline

#2 2020-05-22 14:16:36

Bamarin
Member
From: Sweden
Registered: 2019-12-22
Posts: 9
Website

Re: [SOLVED] bundler: failed to load command: jekyll

I forgot to mention that updating gem and reinstalling jekyll didn't fix the problem

Offline

#3 2020-05-22 14:18:18

Bamarin
Member
From: Sweden
Registered: 2019-12-22
Posts: 9
Website

Re: [SOLVED] bundler: failed to load command: jekyll

Installing the package libffi6 fixed the problem

Offline

#4 2020-05-22 14:28:52

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,611

Re: [SOLVED] bundler: failed to load command: jekyll

No, that didn't fix it, it worked around it. Using an old, unsupported lib instead of building against the new one is not a good idea.

Offline

#5 2020-05-22 14:28:58

loqs
Member
Registered: 2014-03-06
Posts: 10,578

Re: [SOLVED] bundler: failed to load command: jekyll

/usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.1/ffi_c.so

Would it not be better to have uninstalled ffi and reinstalled it locally built against libffi.so.7?

Offline

#6 2020-05-22 16:20:52

Bamarin
Member
From: Sweden
Registered: 2019-12-22
Posts: 9
Website

Re: [SOLVED] bundler: failed to load command: jekyll

loqs wrote:

Would it not be better to have uninstalled ffi and reinstalled it locally built against libffi.so.7?

Not sure what you mean. Could you describe the steps/point me to the wiki page that describes it? I guess with "reinstall locally" you are not referring to offline installation of packages, because I don't see how it would help

Offline

#7 2020-05-22 16:45:09

loqs
Member
Registered: 2014-03-06
Posts: 10,578

Re: [SOLVED] bundler: failed to load command: jekyll

bundler: failed to load command: jekyll (~/.gem/ruby/2.7.0/bin/jekyll)
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.1/ffi_c.so
  /usr/lib/ruby/gems/2.7.0/gems/ffi-1.12.1/lib/ffi.rb:6:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/ffi-1.12.1/lib/ffi.rb:6:in `rescue in <top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/ffi-1.12.1/lib/ffi.rb:3:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `require_relative'
  /usr/lib/ruby/gems/2.7.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll/converters/scss.rb:3:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll-sass-converter.rb:4:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/lib/jekyll.rb:206:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/lib/jekyll.rb:206:in `<top (required)>'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/exe/jekyll:8:in `require'
  /usr/lib/ruby/gems/2.7.0/gems/jekyll-4.0.0/exe/jekyll:8:in `<top (required)>'
  ~/gem/ruby/2.7.0/bin/jekyll:23:in `load'
  ~/gem/ruby/2.7.0/bin/jekyll:23:in `<top (required)>'

Contains paths in the users home directory and system paths.
What is the output of the following (to see if the library linked to libffs.so.6 is provided by a package pacman is managing)

pacman -Qo /usr/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.12.1/ffi_c.so

Offline

#8 2020-05-22 17:25:50

Bamarin
Member
From: Sweden
Registered: 2019-12-22
Posts: 9
Website

Re: [SOLVED] bundler: failed to load command: jekyll

Quite strangely, no package owns it

Offline

#9 2020-05-22 17:47:22

loqs
Member
Registered: 2014-03-06
Posts: 10,578

Re: [SOLVED] bundler: failed to load command: jekyll

Is it shown in the output of

gem list

Offline

#10 2020-05-22 18:19:34

Bamarin
Member
From: Sweden
Registered: 2019-12-22
Posts: 9
Website

Re: [SOLVED] bundler: failed to load command: jekyll

gem list | grep ffi               

ffi (1.12.2, 1.12.1, 1.11.3)
public_suffix (4.0.5, 4.0.3, 3.1.1)

Offline

#11 2020-05-22 18:25:13

loqs
Member
Registered: 2014-03-06
Posts: 10,578

Re: [SOLVED] bundler: failed to load command: jekyll

As gems is currently managing ffi,  use gems to remove it,  then install a version managed by pacman.  That should fix the issue:

# gem uninstall ffi
# pacman -S ruby-ffi

jekyll will still be managed by bundle rather than pacman.
Edit:
Please also stop installing gems as root.

Last edited by loqs (2020-05-22 18:31:32)

Offline

#12 2020-05-22 18:41:25

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,309

Re: [SOLVED] bundler: failed to load command: jekyll

Bamarin wrote:
bundler: failed to load command: jekyll (~/.gem/ruby/2.7.0/bin/jekyll)
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.1/ffi_c.so
Bamarin wrote:

I forgot to mention that updating gem and reinstalling jekyll didn't fix the problem


So you tried reinstalling *jekyll*, even though it is not the *jekyll* gem that is broken -- the error comes instead from the *ffi* gem, which provides ffi_c.so that links to /usr/lib/libffi.so.6

There is an obvious answer to this problem (rebuild the ffi gem) and a correct answer to this problem (use pacman to manage ruby-ffi as well as any other gems installed in /usr, don't ever use sudo gem install anything).


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

Offline

#13 2020-05-22 20:43:53

Bamarin
Member
From: Sweden
Registered: 2019-12-22
Posts: 9
Website

Re: [SOLVED] bundler: failed to load command: jekyll

Honestly I don't remember installing any gem with sudo, but that could have been a long ago...
Anyway when I try uninstalling I get this error

sudo gem uninstall ffi                

Select gem to uninstall:
 1. ffi-1.12.1
 2. ffi-1.12.2
 3. All versions
> 3
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::RDoc

and any gem uninstall command afterwards also gives

Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
Ignoring ffi-1.12.1 because its extensions are not built. Try: gem pristine ffi --version 1.12.1

Which I guess is caused by the fact that they aren't fully uninstalled.

Thanks for the help though, I'll mark this solved and do a fresh install of all ruby environment as soon as I'll have the time

Offline

Board footer

Powered by FluxBB