helaili / jekyll-action

A GitHub Action to publish Jekyll based content as a GitHub Pages site
MIT License
250 stars 120 forks source link

Error loading shared library libffi.so #112

Closed 1995parham closed 2 years ago

1995parham commented 2 years ago

I have the following error on the build procedure:

LoadError: Error loading shared library libffi.so.7: No such file or directory (needed by /github/workspace/vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi_c.so) - /github/workspace/vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi_c.so
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `require'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `require'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `require'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `require'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `require'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `<top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/exe/jekyll:8:in `require'
  /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/exe/jekyll:8:in `<top (required)>'
  /github/workspace/vendor/bundle/ruby/2.7.0/bin/jekyll:23:in `load'
  /github/workspace/vendor/bundle/ruby/2.7.0/bin/jekyll:23:in `<top (required)>'

I am using the following dependencies:

source 'https://rubygems.org'

gem 'jekyll', '~> 4.2'

group :jekyll_plugins do
  gem 'jekyll-timeago', '~> 0.14.0'
  gem 'jekyll-gist', '~> 1.5.0'
end
DaniruKun commented 2 years ago

@1995parham I found a simple workaround for now. In your workflow file, add this pre-build command:

    - uses: helaili/jekyll-action@v2
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        pre_build_commands: 'bundle update ffi'
        target_branch: 'gh-pages'

This should force install the native lib for the gem, which seemed to have been dropped from the latest Ubuntu version that the action runs on.

1995parham commented 2 years ago

@DaniruKun thanks, it is working :+1: