Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README for MacOS installation with linker failure #1209

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,29 @@ the library file `libmysqlclient.so` but is missing the header file `mysql.h`

### Mac OS X

``` sh
brew install openssl
gem install mysql2 -- --with-opt-dir="$(brew --prefix openssl)"
```

You may hit this issue `ld: library not found for -lssl`, because [MacOS is pointing to
LibreSSL instead of OpenSSL](https://stackoverflow.com/questions/62195898/openssl-still-pointing-to-libressl-2-8-3).

You may use MacPorts, Homebrew, or a native MySQL installer package. The most
common paths will be automatically searched. If you want to select a specific
MySQL directory, use the `--with-mysql-dir` or `--with-mysql-config` options above.

If you have not done so already, you will need to install the XCode select tools by running
`xcode-select --install`.

If you are using `bundle install` to manage dependencies in project, you might need to set
`bundle config`.
``` sh
brew install openssl
bundle config --local build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
bundle install
```

### Windows

Make sure that you have Ruby and the DevKit compilers installed. We recommend
Expand Down