在 M1 芯片(Apple Silicon)上运行 rails s 出现错误

13

我正在尝试学习Rails,在运行服务器时遇到了问题。我阅读了Reddit、YouTube教程、Stackoverflow帖子和博客,并得出结论,当你在使用M1芯片进行开发(除前端之外)时,确实存在已知问题。

根据我下方提供的论坛主题链接,msgpack与苹果架构不兼容。我真的不知道如何构建它,以使其与M1芯片兼容。

PS:我在Rails中相对较新,如果我的帖子有任何错误,我提前道歉。我接受纠正。

期望输出:

在M1芯片上运行rails s(如有可能,请勿使用rosetta)

我迄今为止所做的:

  1. 尝试bundle install(请参见以下内容bundle install后的输出)
  2. 在bundle install后退出终端
  3. 阅读本论坛主题 https://superuser.com/questions/1618896/how-to-run-ruby-on-rails-on-new-macbook-air-m1/1619366

我的设置:

ruby 2.7.2p137(2020-10-01 revision 5445e04352)[arm64-darwin20](系统ruby)

Rails 6.1.1

yarn 1.22.10

node v14.15.4

版本管理器:ASDF

IDE:Sublime Text

bundle install输出:

Using rake 13.0.3
Using concurrent-ruby 1.1.8
Using i18n 1.8.8
Using minitest 5.14.3
Using tzinfo 2.0.4
Using zeitwerk 2.4.2
Using activesupport 6.1.1
Using builder 3.2.4
Using erubi 1.10.0
Using racc 1.5.2
Using nokogiri 1.11.1 (arm64-darwin)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.9.0
Using rails-html-sanitizer 1.3.0
Using actionview 6.1.1
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.1.1
Using nio4r 2.5.4
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.3
Using actioncable 6.1.1
Using globalid 0.4.2
Using activejob 6.1.1
Using activemodel 6.1.1
Using activerecord 6.1.1
Using mimemagic 0.3.5
Using marcel 0.3.3
Using activestorage 6.1.1
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailbox 6.1.1
Using actionmailer 6.1.1
Using actiontext 6.1.1
Using public_suffix 4.0.6
Using addressable 2.7.0
Using bindex 0.8.1
Using msgpack 1.4.2
Using bootsnap 1.7.0
Using bundler 2.2.7
Using byebug 11.1.3
Using regexp_parser 2.0.3
Using xpath 3.2.0
Using capybara 3.35.3
Using childprocess 3.0.0
Using ffi 1.14.2
Using jbuilder 2.11.2
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using listen 3.4.1
Using method_source 1.0.0
Using puma 5.2.0
Using rack-mini-profiler 2.3.1
Using rack-proxy 0.6.5
Using thor 1.1.0
Using railties 6.1.1
Using sprockets 4.0.2
Using sprockets-rails 3.2.2
Using rails 6.1.1
Using rubyzip 2.3.0
Using sassc 2.4.0
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using selenium-webdriver 3.142.7
Using semantic_range 2.3.1
Using spring 2.1.1
Using sqlite3 1.4.2
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using web-console 4.1.0
Using webdrivers 4.5.0
Using webpacker 5.2.1
Bundle complete! 17 Gemfile dependencies, 74 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

rails s 的输出结果:

Traceback (most recent call last):
    29: from bin/rails:2:in `<main>'
    28: from bin/rails:2:in `load'
    27: from /Users/leatinoso/facebook/bin/spring:7:in `<top (required)>'
    26: from /Users/leatinoso/facebook/bin/spring:7:in `tap'
    25: from /Users/leatinoso/facebook/bin/spring:10:in `block in <top (required)>'
    24: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
    23: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
    22: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
    21: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
    20: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
    19: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
    18: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
    17: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
    16: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
    15: from /Users/leatinoso/facebook/bin/rails:4:in `<top (required)>'
    14: from /Users/leatinoso/facebook/bin/rails:4:in `require_relative'
    13: from /Users/leatinoso/facebook/config/boot.rb:4:in `<top (required)>'
    12: from /Users/leatinoso/facebook/config/boot.rb:4:in `require'
    11: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/setup.rb:2:in `<top (required)>'
    10: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/setup.rb:2:in `require_relative'
     9: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap.rb:5:in `<top (required)>'
     8: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap.rb:5:in `require_relative'
     7: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache.rb:61:in `<top (required)>'
     6: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache.rb:61:in `require_relative'
     5: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache/store.rb:4:in `<top (required)>'
     4: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/explicit_require.rb:41:in `with_gems'
     3: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache/store.rb:4:in `block in <top (required)>'
     2: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache/store.rb:4:in `require'
     1: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `<top (required)>'
/Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `require': dlopen(/Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle, 9): no suitable image found.  Did find: (LoadError)
    /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture
    /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture - /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle
    30: from bin/rails:2:in `<main>'
    29: from bin/rails:2:in `load'
    28: from /Users/leatinoso/facebook/bin/spring:7:in `<top (required)>'
    27: from /Users/leatinoso/facebook/bin/spring:7:in `tap'
    26: from /Users/leatinoso/facebook/bin/spring:10:in `block in <top (required)>'
    25: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
    24: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
    23: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
    22: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
    21: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
    20: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
    19: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
    18: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
    17: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
    16: from /Users/leatinoso/facebook/bin/rails:4:in `<top (required)>'
    15: from /Users/leatinoso/facebook/bin/rails:4:in `require_relative'
    14: from /Users/leatinoso/facebook/config/boot.rb:4:in `<top (required)>'
    13: from /Users/leatinoso/facebook/config/boot.rb:4:in `require'
    12: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/setup.rb:2:in `<top (required)>'
    11: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/setup.rb:2:in `require_relative'
    10: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap.rb:5:in `<top (required)>'
     9: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap.rb:5:in `require_relative'
     8: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache.rb:61:in `<top (required)>'
     7: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache.rb:61:in `require_relative'
     6: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache/store.rb:4:in `<top (required)>'
     5: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/explicit_require.rb:40:in `with_gems'
     4: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/explicit_require.rb:44:in `rescue in with_gems'
     3: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache/store.rb:4:in `block in <top (required)>'
     2: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache/store.rb:4:in `require'
     1: from /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `<top (required)>'
/Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack.rb:8:in `require': dlopen(/Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle, 9): no suitable image found.  Did find: (LoadError)
    /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture
    /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle: mach-o, but wrong architecture - /Users/leatinoso/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/msgpack-1.4.2/lib/msgpack/msgpack.bundle

Gemfile.lock 文件:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (6.1.1)
      actionpack (= 6.1.1)
      activesupport (= 6.1.1)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (6.1.1)
      actionpack (= 6.1.1)
      activejob (= 6.1.1)
      activerecord (= 6.1.1)
      activestorage (= 6.1.1)
      activesupport (= 6.1.1)
      mail (>= 2.7.1)
    actionmailer (6.1.1)
      actionpack (= 6.1.1)
      actionview (= 6.1.1)
      activejob (= 6.1.1)
      activesupport (= 6.1.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.1.1)
      actionview (= 6.1.1)
      activesupport (= 6.1.1)
      rack (~> 2.0, >= 2.0.9)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (6.1.1)
      actionpack (= 6.1.1)
      activerecord (= 6.1.1)
      activestorage (= 6.1.1)
      activesupport (= 6.1.1)
      nokogiri (>= 1.8.5)
    actionview (6.1.1)
      activesupport (= 6.1.1)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.1.1)
      activesupport (= 6.1.1)
      globalid (>= 0.3.6)
    activemodel (6.1.1)
      activesupport (= 6.1.1)
    activerecord (6.1.1)
      activemodel (= 6.1.1)
      activesupport (= 6.1.1)
    activestorage (6.1.1)
      actionpack (= 6.1.1)
      activejob (= 6.1.1)
      activerecord (= 6.1.1)
      activesupport (= 6.1.1)
      marcel (~> 0.3.1)
      mimemagic (~> 0.3.2)
    activesupport (6.1.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
      zeitwerk (~> 2.3)
    addressable (2.7.0)
      public_suffix (>= 2.0.2, < 5.0)
    bindex (0.8.1)
    bootsnap (1.7.0)
      msgpack (~> 1.0)
    builder (3.2.4)
    byebug (11.1.3)
    capybara (3.35.3)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (>= 1.5, < 3.0)
      xpath (~> 3.2)
    childprocess (3.0.0)
    concurrent-ruby (1.1.8)
    crass (1.0.6)
    erubi (1.10.0)
    ffi (1.14.2)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    i18n (1.8.8)
      concurrent-ruby (~> 1.0)
    jbuilder (2.11.2)
      activesupport (>= 5.0.0)
    listen (3.4.1)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    loofah (2.9.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    method_source (1.0.0)
    mimemagic (0.3.5)
    mini_mime (1.0.2)
    minitest (5.14.3)
    msgpack (1.4.2)
    nio4r (2.5.4)
    nokogiri (1.11.1-arm64-darwin)
      racc (~> 1.4)
    public_suffix (4.0.6)
    puma (5.2.0)
      nio4r (~> 2.0)
    racc (1.5.2)
    rack (2.2.3)
    rack-mini-profiler (2.3.1)
      rack (>= 1.2.0)
    rack-proxy (0.6.5)
      rack
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (6.1.1)
      actioncable (= 6.1.1)
      actionmailbox (= 6.1.1)
      actionmailer (= 6.1.1)
      actionpack (= 6.1.1)
      actiontext (= 6.1.1)
      actionview (= 6.1.1)
      activejob (= 6.1.1)
      activemodel (= 6.1.1)
      activerecord (= 6.1.1)
      activestorage (= 6.1.1)
      activesupport (= 6.1.1)
      bundler (>= 1.15.0)
      railties (= 6.1.1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    railties (6.1.1)
      actionpack (= 6.1.1)
      activesupport (= 6.1.1)
      method_source
      rake (>= 0.8.7)
      thor (~> 1.0)
    rake (13.0.3)
    rb-fsevent (0.10.4)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    regexp_parser (2.0.3)
    rubyzip (2.3.0)
    sass-rails (6.0.0)
      sassc-rails (~> 2.1, >= 2.1.1)
    sassc (2.4.0)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    selenium-webdriver (3.142.7)
      childprocess (>= 0.5, < 4.0)
      rubyzip (>= 1.2.2)
    semantic_range (2.3.1)
    spring (2.1.1)
    sprockets (4.0.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.2)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.4.2)
    thor (1.1.0)
    tilt (2.0.10)
    turbolinks (5.2.1)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (2.0.4)
      concurrent-ruby (~> 1.0)
    web-console (4.1.0)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webdrivers (4.5.0)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (>= 3.0, < 4.0)
    webpacker (5.2.1)
      activesupport (>= 5.2)
      rack-proxy (>= 0.6.1)
      railties (>= 5.2)
      semantic_range (>= 2.3.0)
    websocket-driver (0.7.3)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.4.2)

PLATFORMS
  arm64-darwin-20

DEPENDENCIES
  bootsnap (>= 1.4.4)
  byebug
  capybara (>= 3.26)
  jbuilder (~> 2.7)
  listen (~> 3.3)
  puma (~> 5.0)
  rack-mini-profiler (~> 2.0)
  rails (~> 6.1.1)
  sass-rails (>= 6)
  selenium-webdriver
  spring
  sqlite3 (~> 1.4)
  turbolinks (~> 5)
  tzinfo-data
  web-console (>= 4.1.0)
  webdrivers
  webpacker (~> 5.0)

RUBY VERSION
   ruby 2.7.2p137

BUNDLED WITH
   2.2.7

Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.2'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 4.1.0'
  # Display performance information such as SQL time and flame graphs for each request in your browser.
  # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
  gem 'rack-mini-profiler', '~> 2.0'
  gem 'listen', '~> 3.3'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 3.26'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

更新 安装msgpack gem解决了问题。感谢所有的帮助。我只是通过终端运行命令“gem i msgpack”。


2
也许这可以帮助你:https://github.com/msgpack/msgpack-ruby/issues/195 - Stefan
2个回答

7
我也是一名MBA M1 Rails开发人员。在遇到一些特定的gems(包括nokogiri和ffi等)问题后,我决定卸载所有内容并从头开始制作一个“终端-罗塞塔”应用程序快捷方式。我重新安装了从homebrew到asdf和rails的所有内容,并自此以来一直在愉快地开发。
可以在这里找到非常好的指南。我相信我一直遵循该指南,直到他进行本机版本更新为止,如果您想尝试该版本,请注意,如果您通过您的“终端-罗塞塔”遵循该指南,则不需要按照指定位置创建别名a、ibrew或运行它们。
我必须说,在这个设置中工作了一个月,它非常稳定,唯一偶尔需要做的就是更新一些在旧项目上出现问题的特定gems。

如果您选择使用Rosetta或Native版本,请告诉我它们的效果如何。


5

在你的终端中

$ gem install msgpack

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