0

I am new on RoR and created a new project with all configurations of ruby and rails.

I have

  • mac version 12.4 Monterey
  • rails 6.0.5
  • ruby 2.7.2
  • postgresql

I configured these using rbnev from this tutorial https://gorails.com/setup/osx/12-monterey and https://collectionbuilder.github.io/cb-docs/docs/software/ruby_mac/

I created new app using rails new myapp -d postgresql. It's showing this error while building the project:

/Library/Ruby/Gems/2.6.0/gems/activesupport-6.0.5/lib/active_support/message_encryptor.rb:173:in `auth_data=': couldn't set additional authenticated data (OpenSSL::Cipher::CipherError)
    from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.0.5/lib/active_support/message_encryptor.rb:173:in `_encrypt'
    from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.0.5/lib/active_support/message_encryptor.rb:151:in `encrypt_and_sign'
    from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.0.5/lib/active_support/encrypted_file.rb:76:in `encrypt'
    from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.0.5/lib/active_support/encrypted_file.rb:50:in `write'
    from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.0.5/lib/active_support/encrypted_configuration.rb:29:in `write'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/generators/rails/credentials/credentials_generator.rb:30:in `add_credentials_file_silently'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/generators/rails/app/app_generator.rb:177:in `credentials'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/generators/app_base.rb:155:in `build'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/generators/rails/app/app_generator.rb:332:in `create_credentials'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `block in invoke_all'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `each'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `map'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `invoke_all'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/group.rb:232:in `dispatch'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/commands/application/application_command.rb:26:in `perform'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /Library/Ruby/Gems/2.6.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/command/base.rb:69:in `perform'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/command.rb:46:in `invoke'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/lib/rails/cli.rb:18:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
    from /Library/Ruby/Gems/2.6.0/gems/railties-6.0.5/exe/rails:10:in `<top (required)>'
    from /usr/bin/rails:22:in `load'
    from /usr/bin/rails:22:in `<main>'
Holger Just
  • 52,918
  • 14
  • 115
  • 123
gul Ranaa
  • 13
  • 5
  • Try to reinstall rails gem in your device. that may help you and let me know what happend... – Abrar Jahin Jul 07 '22 at 15:35
  • 1
    i have rails 6.0.5 but when i try to uninstall the rails by using "gem uninstall rails" it's showing: Gem 'rails' is not installed – gul Ranaa Jul 07 '22 at 15:48
  • @AbrarJahin it's showing me the rails version but don't have any local gems rails in my system – gul Ranaa Jul 07 '22 at 16:05
  • Did you tried to run `gem install rails` command again after getting the `Gem 'rails' is not installed` – Abrar Jahin Jul 09 '22 at 04:47
  • yes i tried this command but it gives me this --> ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory. – gul Ranaa Jul 12 '22 at 18:59

1 Answers1

0

According to your issues on MAC device for ROR, You might be facing the issues because of versioning system and rbnev, and I got an article over the internet that described the same issue with some solutions.

Maybe this article will help you to fix that problem

If you can fix the issue from the article then let me know here too.

Abrar Jahin
  • 391
  • 2
  • 11