1

在我的 M1 Mac 上升级我的 Rails 项目时遇到与 Debase 相关的问题,因为无法编译symbol not found in flat namespace '_RHASH_EMPTY_P'

操作系统:Monterey 12.0.1 机器:Mac mini (m1, 2020) Ruby 版本:3.0.2 Rails:6.1.4.1

我试过删除 Gemfile.lock 并完全重新安装 brew/rbenv/rails。该应用程序在 Ruby:3.0.2 docker 映像上成功运行。

当我运行时rails s,我得到以下堆栈跟踪:

/Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': dlopen(/Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/debase-0.2.4.1/lib/debase_internals.bundle, 0x0009): symbol not found in flat namespace '_RHASH_EMPTY_P' - /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/debase-0.2.4.1/lib/debase_internals.bundle (LoadError)
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `block in require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in `load_dependency'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/debase-0.2.4.1/lib/debase.rb:4:in `<main>'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `block in require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in `load_dependency'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide.rb:9:in `<main>'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/runtime.rb:55:in `each'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/runtime.rb:55:in `block in require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/runtime.rb:44:in `each'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler/runtime.rb:44:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/lib/bundler.rb:175:in `require'
    from /Users/josh/Documents/Development/hub/config/application.rb:20:in `<main>'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `block in require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in `load_dependency'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/commands/server/server_command.rb:138:in `block in perform'
    from <internal:kernel>:90:in `tap'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/commands/server/server_command.rb:135:in `perform'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/command/base.rb:69:in `perform'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/command.rb:48:in `invoke'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/commands.rb:18:in `<main>'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /Users/josh/Documents/Development/hub/bin/rails:9:in `<top (required)>'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
    from /Users/josh/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
    from <internal:/Users/josh/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from <internal:/Users/josh/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/josh/Documents/Development/hub/bin/spring:15:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'
4

1 回答 1

2

据我所知,debase与 ruby​​ 3尚不兼容,我认为两者都没有像其他类似的 gem 那样得到很好的维护。就个人而言,我会转向pry-byebug或至少byebug
我可以看到您的其他选择是删除 gem,降级到 ruby​​ 2.7,或者只是贡献一个 PR 来修复 debase 并使其与 ruby​​ 3 兼容。

于 2021-11-12T20:05:40.287 回答