Error when trying to install app with mysql2 gem

前端 未结 11 1979
鱼传尺愫
鱼传尺愫 2020-12-02 06:52

Im trying to install an open source rails 3.2.21 application that uses the mysql2 gem, but when i try and run the bundle commant I get the followin

11条回答
  •  臣服心动
    2020-12-02 07:48

    For anybody still experiencing the issue:

    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.

提交回复
热议问题