Gem ffi not found

I had a hard drive failure on my old laptop, so moving stuff to new laptop. Installed as normal and was surprised at the following output:

pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle exec jekyll serve
Could not find ffi-1.15.0 in any of the sources
Run `bundle install` to install missing gems.
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle install
Using public_suffix 4.0.6
Using addressable 2.7.0
Using bundler 2.2.28
Using colorator 1.1.0
Using concurrent-ruby 1.1.8
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.2
Using ffi 1.15.0
Using forwardable-extended 2.6.0
Using i18n 0.9.5
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using listen 3.5.1
Using jekyll-watch 2.2.1
Using rexml 3.2.5
Using kramdown 2.3.1
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.26.0
Using safe_yaml 1.0.5
Using jekyll 3.9.1
Using jekyll-feed 0.15.1
Using jekyll-seo-tag 2.7.1
Using jekyll-sitemap 1.4.0
Using kramdown-parser-gfm 1.1.0
Bundle complete! 5 Gemfile dependencies, 30 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle info ffi
  * ffi (1.15.0)
        Summary: Ruby FFI
        Homepage: https://github.com/ffi/ffi/wiki
        Documentation: https://github.com/ffi/ffi/wiki
        Source Code: https://github.com/ffi/ffi/
        Wiki: https://github.com/ffi/ffi/wiki
        Changelog: https://github.com/ffi/ffi/blob/master/CHANGELOG.md
        Bug Tracker: https://github.com/ffi/ffi/issues
        Mailing List: http://groups.google.com/group/ruby-ffi
        Path: /home/pault/gems/gems/ffi-1.15.0

The Path is also where the rest of the gems live. Can anyone shed any light?

Maybe you just need to run:

bundle install
bundle update

And then try running your site again?

Thank you @BillRaymond. I now get the following output, basically updated versions but the same error with another doing the same:

pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle update
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using bundler 2.2.28
Using colorator 1.1.0
Using eventmachine 1.2.7
Using forwardable-extended 2.6.0
Using rexml 3.2.5
Using liquid 4.0.3
Using mercenary 0.3.6
Fetching rouge 3.28.0 (was 3.26.0)
Fetching http_parser.rb 0.8.0 (was 0.6.0)
Fetching rb-fsevent 0.11.1 (was 0.10.4)
Fetching ffi 1.15.5 (was 1.15.0)
Fetching concurrent-ruby 1.1.10 (was 1.1.8)
Fetching public_suffix 4.0.7 (was 4.0.6)
Fetching kramdown 2.4.0 (was 2.3.1)
Using safe_yaml 1.0.5
Using pathutil 0.16.2
Installing public_suffix 4.0.7 (was 4.0.6)
Using addressable 2.8.0 (was 2.7.0)
Installing rb-fsevent 0.11.1 (was 0.10.4)
Installing kramdown 2.4.0 (was 2.3.1)
Using kramdown-parser-gfm 1.1.0
Installing http_parser.rb 0.8.0 (was 0.6.0) with native extensions
Fetching em-websocket 0.5.3 (was 0.5.2)
Installing concurrent-ruby 1.1.10 (was 1.1.8)
Using i18n 0.9.5
Installing em-websocket 0.5.3 (was 0.5.2)
Installing rouge 3.28.0 (was 3.26.0)
Installing ffi 1.15.5 (was 1.15.0) with native extensions
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Fetching listen 3.7.1 (was 3.5.1)
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Installing listen 3.7.1 (was 3.5.1)
Using jekyll-watch 2.2.1
Using jekyll 3.9.2 (was 3.9.1)
Using jekyll-sitemap 1.4.0
Fetching jekyll-seo-tag 2.8.0 (was 2.7.1)
Fetching jekyll-feed 0.16.0 (was 0.15.1)
Installing jekyll-feed 0.16.0 (was 0.15.1)
Installing jekyll-seo-tag 2.8.0 (was 2.7.1)
Bundle updated!
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle exec jekyll serve
Could not find http_parser.rb-0.8.0, ffi-1.15.5 in any of the sources
Run `bundle install` to install missing gems.
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle install
Using public_suffix 4.0.7
Using addressable 2.8.0
Using bundler 2.2.28
Using colorator 1.1.0
Using concurrent-ruby 1.1.10
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using em-websocket 0.5.3
Using ffi 1.15.5
Using forwardable-extended 2.6.0
Using i18n 0.9.5
Using rb-fsevent 0.11.1
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using listen 3.7.1
Using jekyll-watch 2.2.1
Using rexml 3.2.5
Using kramdown 2.4.0
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.28.0
Using safe_yaml 1.0.5
Using jekyll 3.9.2
Using jekyll-feed 0.16.0
Using jekyll-seo-tag 2.8.0
Using jekyll-sitemap 1.4.0
Using kramdown-parser-gfm 1.1.0
Bundle complete! 5 Gemfile dependencies, 30 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle exec jekyll serve
Could not find http_parser.rb-0.8.0, ffi-1.15.5 in any of the sources
Run `bundle install` to install missing gems.
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle info ffi && bundle info http_parser.rb
  * ffi (1.15.5)
        Summary: Ruby FFI
        Homepage: https://github.com/ffi/ffi/wiki
        Documentation: https://github.com/ffi/ffi/wiki
        Source Code: https://github.com/ffi/ffi/
        Wiki: https://github.com/ffi/ffi/wiki
        Changelog: https://github.com/ffi/ffi/blob/master/CHANGELOG.md
        Bug Tracker: https://github.com/ffi/ffi/issues
        Mailing List: http://groups.google.com/group/ruby-ffi
        Path: /home/pault/gems/gems/ffi-1.15.5
  * http_parser.rb (0.8.0)
        Summary: Simple callback-based HTTP request/response parser
        Homepage: https://github.com/tmm1/http_parser.rb
        Path: /home/pault/gems/gems/http_parser.rb-0.8.0

Is that the full log? Sometimes the issue is you need to add webrick even though I don’t see the error, please try that first:

bundle add webrick
bundle install
bundle uodate

Yes, full log. Still no cigar though:

pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle add webrick
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using bundler 2.2.28
Using rb-fsevent 0.11.1
Using colorator 1.1.0
Using concurrent-ruby 1.1.10
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using ffi 1.15.5
Using rexml 3.2.5
Using liquid 4.0.3
Using mercenary 0.3.6
Using safe_yaml 1.0.5
Using forwardable-extended 2.6.0
Using public_suffix 4.0.7
Using i18n 0.9.5
Using pathutil 0.16.2
Using rb-inotify 0.10.1
Using addressable 2.8.0
Using sass-listen 4.0.0
Using listen 3.7.1
Using kramdown 2.4.0
Using em-websocket 0.5.3
Fetching webrick 1.7.0
Using sass 3.7.4
Using jekyll-watch 2.2.1
Using jekyll-sass-converter 1.5.2
Using rouge 3.28.0
Using kramdown-parser-gfm 1.1.0
Using jekyll 3.9.2
Using jekyll-feed 0.16.0
Using jekyll-seo-tag 2.8.0
Using jekyll-sitemap 1.4.0
Installing webrick 1.7.0
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle install
Using public_suffix 4.0.7
Using addressable 2.8.0
Using bundler 2.2.28
Using colorator 1.1.0
Using concurrent-ruby 1.1.10
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using em-websocket 0.5.3
Using ffi 1.15.5
Using forwardable-extended 2.6.0
Using i18n 0.9.5
Using rb-fsevent 0.11.1
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using listen 3.7.1
Using jekyll-watch 2.2.1
Using rexml 3.2.5
Using kramdown 2.4.0
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.28.0
Using safe_yaml 1.0.5
Using jekyll 3.9.2
Using jekyll-feed 0.16.0
Using jekyll-seo-tag 2.8.0
Using jekyll-sitemap 1.4.0
Using kramdown-parser-gfm 1.1.0
Using webrick 1.7.0
Bundle complete! 6 Gemfile dependencies, 31 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle update
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using public_suffix 4.0.7
Using bundler 2.2.28
Using colorator 1.1.0
Using concurrent-ruby 1.1.10
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using ffi 1.15.5
Using forwardable-extended 2.6.0
Using rb-fsevent 0.11.1
Using rexml 3.2.5
Using liquid 4.0.3
Using mercenary 0.3.6
Using rouge 3.28.0
Using safe_yaml 1.0.5
Using webrick 1.7.0
Using kramdown 2.4.0
Using em-websocket 0.5.3
Using rb-inotify 0.10.1
Using addressable 2.8.0
Using sass-listen 4.0.0
Using listen 3.7.1
Using kramdown-parser-gfm 1.1.0
Using jekyll-watch 2.2.1
Using i18n 0.9.5
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using pathutil 0.16.2
Using jekyll 3.9.2
Using jekyll-feed 0.16.0
Using jekyll-seo-tag 2.8.0
Using jekyll-sitemap 1.4.0
Bundle updated!
pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ bundle exec jekyll serve
Could not find http_parser.rb-0.8.0, ffi-1.15.5 in any of the sources
Run `bundle install` to install missing gems.

you might have ruby installed twice - and some gems are in the other install? you seem to have ruby at /home/pault/gems/gems/ffi-1.15.0 which seems weird to me, usually the gems are inside a ruby folder? I’m no ruby expert though, just something I have noticed a lot of people having issues with.

just do jekyll server and post the whole output.

Thank you @rdyar. This is from my ~/.bashrc as per installation instructions:

# Install Ruby Gems to ~/gems
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$PATH"

So the output feels right in that sense.

And this is the other output requested:

pault@clitheroe:~/jekyll/topcatradio.eu/topcat-radio$ jekyll server
Ignoring sassc-2.4.0 because its extensions are not built. Try: gem pristine sassc --version 2.4.0
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0
Ignoring http_parser.rb-0.8.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.8.0
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0
Ignoring http_parser.rb-0.8.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.8.0
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': incompatible library version - /home/pault/gems/gems/ffi-1.15.5/lib/ffi_c.so (LoadError)
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/ffi-1.15.5/lib/ffi.rb:5:in `rescue in <top (required)>'
        from /home/pault/gems/gems/ffi-1.15.5/lib/ffi.rb:2:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
        from /home/pault/gems/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
        from /home/pault/gems/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-4.2.1/lib/jekyll.rb:195:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-4.2.1/exe/jekyll:8:in `<top (required)>'
        from /home/pault/gems/bin/jekyll:25:in `load'
        from /home/pault/gems/bin/jekyll:25:in `<main>'
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- 3.0/ffi_c (LoadError)
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/ffi-1.15.5/lib/ffi.rb:3:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
        from /home/pault/gems/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
        from /home/pault/gems/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-4.2.1/lib/jekyll.rb:195:in `<top (required)>'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/pault/gems/gems/jekyll-4.2.1/exe/jekyll:8:in `<top (required)>'
        from /home/pault/gems/bin/jekyll:25:in `load'
        from /home/pault/gems/bin/jekyll:25:in `<main>'

I don’t know ruby internals but it looks like this is the important line:

<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- 3.0/ffi_c (LoadError)

And I also note that two ffi versions are being called. is it advisable to run the gem pristine commands referenced earlier in the output?

hmm, never seen the bashrc file, not sure what it does (I’m a PC person and also not a ruby expert) but it seems fishy that you have gems in 2 different places.

Though the extensions not being built is probably a bigger issue.

When you use ruby some gems are ready to go and other need to be built at install time and to do that you need the ruby dev tools - or at least you used to. I want to say some of that changed a couple years ago.

What OS are you on?

I would remove all ruby stuff and re-install it making sure the ruby version you install has access to the ruby devkit.

Usually you would have seen a different error when installing jekyll though if the extensions are not built so it is a little weird you made it past that part.

.bashrc (or .zshrc) is used in Unix / Linux / MacOS, and the entries are fine indeed.

It’s fixed, but it required uninstalling everything Ruby and starting from scratch. Thinking about what happened I think it was a Ruby 2.7>3.0 issue. The ffi gem still seemed to be looking for /usr/bin/ruby2.7 even though I had uninstalled. The series of posts from @MichaelCurrin on Upgrade to Ruby 3 was very useful. Thanks to everyone for their help.

Glad to hear that worked out for you and I am sorry I could not be of more assistance. I spent about a month learning Docker recently and finally came up with a very easy way to manage my Jekyll code in a container so I do not have to manage Ruby on my desktop anymore. If you are interested in that approach, here is a video I created: