Rails - 类型错误:无法解析类型 'size_t'(Big Sur-M1)

32
我有一个关于在新的mac上安装新的rails应用程序的问题,我真的需要快速解决它。我已经解决了所有与gem相关的问题,bundle update也正常,但我无法运行rails s。我认为这是由于M1的原因,但我找不到任何可以解决我的问题的帖子。 当我在终端中运行rails s时:
   100: from ./bin/rails:3:in `<main>'
    99: from ./bin/rails:3:in `load'
    98: from /Users/emz-laptop/Dropbox/DRIME - Emilie Murat/Dev/prompteo/bin/spring:15:in `<top (required)>'
    97: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
    96: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
    95: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
    94: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
    93: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
    92: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
    91: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
    90: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
    89: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
    88: from /Users/emz-laptop/Dropbox/DRIME - Emilie Murat/Dev/prompteo/bin/rails:9:in `<top (required)>'
    87: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
    86: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
    85: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
    84: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    83: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    82: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
    81: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    80: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    79: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<main>'
    78: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:46:in `invoke'
    77: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/base.rb:65:in `perform'
    76: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    75: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    74: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    73: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `perform'
    72: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `tap'
    71: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:145:in `block in perform'
    70: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
    69: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
    68: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
    67: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    66: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    65: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
    64: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    63: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    62: from /Users/emz-laptop/Dropbox/DRIME - Emilie Murat/Dev/prompteo/config/application.rb:18:in `<main>'
    61: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler.rb:114:in `require'
    60: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:65:in `require'
    59: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:65:in `each'
    58: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:76:in `block in require'
    57: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:76:in `each'
    56: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
    55: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    54: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    53: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
    52: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    51: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    50: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-rails-2.1.0/lib/sassc-rails.rb:3:in `<main>'
    49: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
    48: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
    47: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
    46: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
    45: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    44: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    43: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
    42: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    41: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    40: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-rails-2.1.0/lib/sassc/rails.rb:5:in `<main>'
    39: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
    38: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
    37: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
    36: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    35: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    34: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
    33: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    32: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    31: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc.rb:7:in `<main>'
    30: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
    29: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
    28: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
    27: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
    26: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    25: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    24: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
    23: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    22: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    21: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc/native.rb:5:in `<main>'
    20: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc/native.rb:6:in `<module:SassC>'
    19: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc/native.rb:13:in `<module:Native>'
    18: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
    17: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
    16: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
    15: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
    14: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    13: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    12: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
    11: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    10: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
     9: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc/native/sass_value.rb:3:in `<main>'
     8: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc/native/sass_value.rb:4:in `<module:SassC>'
     7: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc/native/sass_value.rb:52:in `<module:Native>'
     6: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.1/lib/sassc/native/sass_value.rb:53:in `<class:SassList>'
     5: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/ffi-1.10.0/lib/ffi/struct.rb:278:in `layout'
     4: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/ffi-1.10.0/lib/ffi/struct.rb:366:in `array_layout'
     3: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/ffi-1.10.0/lib/ffi/struct.rb:326:in `find_field_type'
     2: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/ffi-1.10.0/lib/ffi/struct.rb:332:in `find_type'
     1: from /Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/ffi-1.10.0/lib/ffi/library.rb:585:in `find_type'
/Users/emz-laptop/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/ffi-1.10.0/lib/ffi/types.rb:69:in `find_type': unable to resolve type 'size_t' (TypeError)

非常感谢您的帮助!

3个回答

45

尝试更新ffi和sassc:

bundle update ffi sassc

3
对我来说,进行宝石原始化并没有起作用,我不得不更新ffi:获取ffi 1.15.1(原来是1.13.1),使用本地扩展安装ffi 1.15.1(原来是1.13.1)。 - Jonathon Horsman

18

似乎 ffisassc gem 的本地代码出现了问题。它们之前是为 Intel x86 架构编译的,现在无法在苹果 M1 ARM 处理器上运行。您只需要重新编译它们:

gem pristine ffi sassc

2
这对我没有起作用。在运行此命令后,我仍然存在相同的问题。 - Etan Mizrahi-Shalom
1
@EtanMizrahi-Shalom 请尝试更新您的gems。 - eikes

5

我遇到了这个错误,但是通过以下步骤来解决:

  1. gem pristine ffi sassc
  2. bundle update ffi
这些步骤可以帮助您解决相关的技术问题。请注意保留HTML标签。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接