rails 在 macOS 上新建失败并显示“无法设置其他经过身份验证的数据”

rails new fails with 'couldn't set additional authenticated data' on macos

我正在尝试让 ruby 在 rails 上使用 M1 芯片开发新的 Mac。 运行 rails newappend .gitignore 之后失败并出现以下错误

/Library/Ruby/Gems/2.6.0/gems/activesupport-6.0.3/lib/active_support/message_encryptor.rb:173:in `auth_data=': couldn't set additional authenticated data (OpenSSL::Cipher::CipherError)

还有其他人 运行 参与其中吗?我的愤怒谷歌搜索没有想出关于这个的任何东西

我建议使用 rbenv 安装 gems 以避免版本冲突,而不是使用系统 ruby。然后你可以使用export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"设置正确的SSL版本