gpt4 book ai didi

ruby-on-rails - libffi.so.8 : cannot open shared object file

转载 作者:行者123 更新时间:2023-12-05 03:30:33 30 4
gpt4 key购买 nike

我将 Rails 升级到 7.0.1。当我执行 rails g controller Pages home 时,出现错误:

>>rails g controller Pages home
/home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require': libffi.so.8: cannot open shared object file: No such file or directory - /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/ffi-1.15.5/lib/ffi_c.so (LoadError)
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/ffi-1.15.5/lib/ffi.rb:5:in `rescue in <main>'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/ffi-
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<main>'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'

from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootstrap-5.1.3/lib/bootstrap/engine.rb:4:in `<main>'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<main>'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails.rb:5:in `<main>'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bundler-2.3.5/lib/bundler.rb:176:in `require'
from /home/shadman/instagram/config/application.rb:7:in `<main>'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/command/actions.rb:22:in `require_application!'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/commands/generate/generate_command.rb:21:in `perform'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/command.rb:48:in `invoke'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/commands.rb:18:in `<main>'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/shadman/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from bin/rails:4:in `<main>'

知道如何解决这个问题吗?

最佳答案

您可以使用随附的内部 libffi 编译 ffi gem。确保版本匹配:

gem install ffi --version '1.15.5' -- --disable-system-libffi

我不知道为什么 ffi 使用系统 libffi 可以很好地编译,但随后拒绝使用它运行。

关于ruby-on-rails - libffi.so.8 : cannot open shared object file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70810903/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com