0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

github actionでdb migrate時にffi周りでLoadErrorが発生した

Posted at

背景

2022/12月になってからgithub actionでdb migrate周りでエラーになり出したので対処の覚書。
(原因を完全に特定しているわけではないのでさっくり)

エラー内容抜粋

LoadError: libffi.so.7: cannot open shared object file: No such file or directory - /home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/ffi-1.15.5/lib/ffi_c.so
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in `block in require'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in `load_dependency'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in `require'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/ffi-1.15.5/lib/ffi.rb:5:in `rescue in <main>'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/ffi-1.15.5/lib/ffi.rb:2:in `<main>'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in `block in require'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in `load_dependency'
/home/runner/work/appname/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in `require'
...

似ていそうな問題
https://github.com/ffi/ffi/issues/881
https://github.com/orgs/community/discussions/24949

当方も ruby/setup-ruby@v1 を利用しており、bundlerのキャッシュが効いている状態でffi周りのファイルが足りないと言うエラーが発生した。

対応

github actionのymlで cache-version を変更

      - name: Setup ruby
        uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
          ruby-version: 3.0.2
-         cache-version: 1
+         cache-version: 2
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?