Skip to content

Commit 84c99f6

Browse files
authored
doc: update macOS OpenSSL instructions to use OpenSSL 3.x (#1409)
- https://formulae.brew.sh/formula/openssl@3 - https://ports.macports.org/port/openssl3/ Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
1 parent 4463cac commit 84c99f6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ find the particular package. The most common issue we see is a user who has
9090
the 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

9596
You may use Homebrew, MacPorts, or a native MySQL installer package. The most
9697
common 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
102103
Later versions of MacOS no longer distribute a linkable OpenSSL library. It is
103104
common to use Homebrew or MacPorts to install OpenSSL. Make sure that both the
104105
Ruby 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

111112
or
112113

113-
$ sudo port install openssl11
114+
$ sudo port install openssl3
114115
```
115116

116117
Since most Ruby projects use Bundler, you can set build options in the Bundler
117118
config rather than manually installing a global mysql2 gem. This example shows
118119
how 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

124125
Another helpful trick is to use the same OpenSSL library that your Ruby was

0 commit comments

Comments
 (0)