0
0

More than 1 year has passed since last update.

【M1 mac】 An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.

Posted at

M1 macでmysql 0.5.3がインストールできない

データベースをMySQLでrails newをしたところ、下記のエラーに遭遇。

$rails new myapp --webpack=react --database=mysql -T

....省略
An error occurred while installing pg (1.3.5), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.3.5' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
...省略

こちらの記事のおかげで無事にインストールできました!!

$ brew install openssl
$ echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
$ source ~/.zshrc
$ bundle config --local build.mysql2 "--with-ldflags=-L/opt/homebrew/opt/openssl@1.1/lib"
$ export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/Cellar/zstd/1.5.2/lib:/opt/homebrew/Cellar/openssl@1.1/1.1.1m/lib/
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0