@@ -90,7 +90,8 @@ find the particular package. The most common issue we see is a user who has
9090the library file ` libmysqlclient.so ` but is missing the header file ` mysql.h `
9191-- double check that you have the _ -dev_ packages installed.
9292
93- ### Mac OS X
93+ ### macOS
94+ <a name =" mac-os-x " >
9495
9596You may use Homebrew, MacPorts, or a native MySQL installer package. The most
9697common paths will be automatically searched. If you want to select a specific
@@ -102,23 +103,23 @@ If you have not done so already, you will need to install the XCode select tools
102103Later versions of MacOS no longer distribute a linkable OpenSSL library. It is
103104common to use Homebrew or MacPorts to install OpenSSL. Make sure that both the
104105Ruby runtime and MySQL client libraries are compiled with the same OpenSSL
105- family, 1.0 or 1.1 or 3.0 , since only one can be loaded at runtime.
106+ family, 3.x , since only one can be loaded at runtime.
106107
107108``` sh
108- $ brew install openssl@1.1 zstd
109- $ gem install mysql2 -- --with-openssl-dir=$( brew --prefix openssl@1.1 )
109+ $ brew install openssl@3 zstd
110+ $ gem install mysql2 -- --with-openssl-dir=$( brew --prefix openssl@3 )
110111
111112or
112113
113- $ sudo port install openssl11
114+ $ sudo port install openssl3
114115```
115116
116117Since most Ruby projects use Bundler, you can set build options in the Bundler
117118config rather than manually installing a global mysql2 gem. This example shows
118119how to set build arguments with [ Bundler config] ( https://bundler.io/man/bundle-config.1.html ) :
119120
120121``` sh
121- $ bundle config --local build.mysql2 -- --with-openssl-dir=$( brew --prefix openssl@1.1 )
122+ $ bundle config --local build.mysql2 -- --with-openssl-dir=$( brew --prefix openssl@3 )
122123```
123124
124125Another helpful trick is to use the same OpenSSL library that your Ruby was
0 commit comments