【Rails】libffi.so.7: cannot open shared object file: No such file or directoryエラー
解決したいこと
libffi.so.7: cannot open shared object file: No such file or directoryというエラーを解決したい。
Ruby on RailsでWebの投稿アプリをつくっています。
herokuにアップしたかったのですが、mimemagic gemに関するエラーが生じ、
下記リンクを参考にmimemagic、railsのアップデートを行っているうちに
"libffi.so.7"が見当たらないというようなエラーが発生しました。
mimemagic参考リンク: https://hackmd.io/@mametter/mimemagic-info-ja
解決方法をご教示いただきたいです。
現在のバージョン
ruby 2.6.5
rails 5.1.6
発生している問題・エラー
/home/ec2-user/.rvm/gems/ruby-2.6.5/gems/ffi-1.15.0/lib/ffi.rb:6:in `require': libffi.so.7: cannot open shared object file: No such file or directory - /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/ffi-1.15.0/lib/ffi_c.so (LoadError)
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/ffi-1.15.0/lib/ffi.rb:6:in `rescue in <top (required)>'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/ffi-1.15.0/lib/ffi.rb:3:in `<top (required)>'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/rb-inotify-0.10.1/lib/rb-inotify/native.rb:1:in `require'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/rb-inotify-0.10.1/lib/rb-inotify/native.rb:1:in `<top (required)>'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/rb-inotify-0.10.1/lib/rb-inotify.rb:2:in `require'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/rb-inotify-0.10.1/lib/rb-inotify.rb:2:in `<top (required)>'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/adapter/linux.rb:30:in `require'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/adapter/linux.rb:30:in `_configure'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/adapter/base.rb:45:in `block in configure'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/adapter/base.rb:40:in `each'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/adapter/base.rb:40:in `configure'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/adapter/base.rb:63:in `start'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/forwardable.rb:230:in `start'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/listener.rb:68:in `block in <class:Listener>'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/fsm.rb:121:in `instance_eval'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/fsm.rb:121:in `call'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/fsm.rb:57:in `transition'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/listen-3.1.5/lib/listen/listener.rb:91:in `start'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-watcher-listen-2.0.1/lib/spring/watcher/listen.rb:27:in `start'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-2.0.2/lib/spring/application.rb:80:in `start_watcher'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-2.0.2/lib/spring/application.rb:89:in `preload'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
該当するソースコード
$ rails s
自分で試したこと
いくつかヒットした記事をみて該当ファイルを作ったり、railsのバージョンをダウングレードしたりしてみましたが解決できませんでした。
参考: https://teratail.com/questions/258395
よろしくお願いいたします。
0