はじめに
僕のローカル環境で毎回エラーになるので解決策をメモします
*まだ厳密な原因はわかってませんが、とりあえずこれで通りました程度の内容です
$ bundle install --path vendor/bundle
...
エラー文↓
An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.
解決方法
$ bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib"
$ bundle install --path vendor/bundle
上記コマンドを実行すると、.bundle/config
に下記一行が追加されます
BUNDLE_BUILD__MYSQL2: "--with-ldflags=-L/usr/local/opt/openssl/lib"
とおるようになる。