[RUBY] mysql2 fails to install with bundle install

I did a lot of research and it didn't come out right away, so I'll leave it.

environment

environment version
Mac 10.15.5
Ruby 2.6.3p62
Mysql 5.7.29

error

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1

make failed, exit code 2

What i did

bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"

Recommended Posts

mysql2 fails to install with bundle install
Rails new fails to install mysql
How to install MySQL
Error with bundle install after upgrading to Catalina
bundle install does not install mysql2
Connect to MySQL 8 with Java
After setting database to mysql, bundle install causes an error
Steps to install MySQL 8 on CentOS 8
[Rails 6] MySQL 2 cannot be bundle install
What to do if mysql2 gets a bundle install error
Update MySQL from 5.7 to 8.0 with Docker
Deploy to heroku with Docker (Rails 6, MySQL)
Docker container build fails to install php-radis
bundle install error
bundle install error
[Rails] Could not locate Gemfile with bundle install
Error deploying rails5 + Mysql to heroku with Docker-compose
Settings for connecting to MySQL with Spring Boot + Spring JDBC
Install java with Homebrew
How to connect MySQL / MariaDB + HikariCP with Liferay 7 / DXP
Install Java with Ansible
How to install & import Auto Gluon with Google Colaboratory
Whether to enable SSL when using JDBC with MySQL.
Bundle install with docker + rails6 does not reflect gem
Install OpenJDK8 with RPM
When semantic-ui install fails
[Java] Connect to MySQL
I started MySQL 5.7 with docker-compose and tried to connect
Install Gradle with ubuntu16.04
How to install Docker
How to install docker-machine
Refusing to install package with name "webpack" under a package
Error when bundle install
What to do when build fails by rbenv install / pyenv install with anyenv (Debian system)
[Docker] Connection with MySQL
[Rails] Development with MySQL
Install MySQL 5.6 on CentOS6 [How to specify the version]
How to install Gradle and Kotlin with SDKMAN (Mac)
Suddenly bundle install is not possible due to gem'ffi'
Install Composer with Docker
How to install ngrok
I tried to make an introduction to PHP + MySQL with Docker
When I changed to M1 mac, bundle install became impossible
bundle install failed (continued). The case caused by gem "MySQL2".
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
Connect to multiple MySQL instances with SSL enabled in JDBC
How to use mysql with M1 mac Docker preview version
docker-compose.yml when you want to keep mysql running with docker
Clogged with Express npm install
Network install CentOS 8 with Kickstart.
[Template] MySQL connection with Java
Install Java 7 with Homebrew (cask)
JUnit 5 fails with java.lang.NoSuchMethodError: org.junit.platform.launcher.Launcher.execute
Java to play with Function
Install Oracle JDK 8 with Ansible
[Rails] How to install devise
How to install Boots Faces
How to number (number) with html.erb
How to update with activerecord-import
Connect to DB with Java
Difference between bundle and bundle install