2

I'm trying to get ruby on rails working on a new Mac with an M1 chip. Running rails new fails after append .gitignore with the following error

/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)
  • MacOS version: 12.3.1 Monterey, Chip: Apple M1 Max
  • Ruby version: 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
  • Rails version: 6.0.3
  • Node version: 14.19.0
  • Yarn version: 1.22.18

Has anyone else run into this? My rage-googling hasn't come up with much of anything on this one

  • Instead of using system ruby, I would suggest using rbenv to install gem to avoid version conflicts. Then you can use `export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"` to set the correct SSL version – TheGeorgeous Apr 18 '22 at 17:36
  • 1
    Interesting... Based on your advice, I set the local ruby version to the installed 2.7.3 (instead of system's 2.6.something, I believe), and then the `rails new` command succeeded.. Since you gave me the idea, do you want to write up an answer and I'll mark it as accepted? – Tomizechsterson Apr 19 '22 at 22:04

1 Answers1

0

Instead of using system ruby, I would suggest using rbenv to install gems to avoid version conflicts. Then you can use export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)" to set the correct SSL version

TheGeorgeous
  • 3,927
  • 2
  • 20
  • 33
  • sorry, newbie here: how do I use `rbenv` to install gems? I'm using `rbvenv` to install Ruby 3.1.2 and this is still failing, even after running the export that you posted – noloman May 29 '22 at 14:19
  • @noloman what error do you get when installing Ruby? – TheGeorgeous May 30 '22 at 09:34
  • 1
    sorry for the delay: what I did was uninstalling Ruby and installing it again and it worked - sort of "have you tried turning the computer off andd on again?" :) – noloman Jun 01 '22 at 07:46