Can't install mysql2 gem on macOS Sierra

后端 未结 12 2112
抹茶落季
抹茶落季 2020-12-23 13:21

I\'m setting up my development environment in the new macOS Sierra .

First of all, I installed Rbenv, Ruby (2.3.1)

12条回答
  •  不知归路
    2020-12-23 14:14

    When you install openssl via brew, you should get the following message:

    Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

    Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables:

    LDFLAGS: -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

    You can set these build flags (for the local application) by running the following:

    bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
    

    This worked for me.

    See bundler's documentation for more information.

提交回复
热议问题