Persistent "libcrypto loading in an unsafe way" Error with Ruby on Rails on macOS

Hello,

I am using a 2017 MacBook Pro with an Intel chip, running Ruby version 2.7.8, Rails 5.2.6, and OpenSSL 1.1. I've installed Ruby using rbenv and ruby-build.

I am persistently receiving the following error when trying to create a database with Rails:

WARNING: /Users/logan/.rbenv/versions/2.7.8/bin/ruby is loading libcrypto in an unsafe way zsh: abort bundle exec bin/rails db:create

Steps I have taken to troubleshoot this issue:

  1. Installed OpenSSL via Homebrew and ensured that the version is 1.1.

  2. Uninstalled and reinstalled Ruby with rbenv, specifying the correct OpenSSL directory.

  3. Set the DYLD_LIBRARY_PATH environment variable to the path where Homebrew installed the OpenSSL libraries before running the Ruby process.

Unfortunately, none of these steps have resolved the problem.

I am seeking assistance in resolving this issue. Any guidance or insight into what might be causing this error and how to fix it would be greatly appreciated.

Thank you in advance for your time and help!