LoginSignup
0
1

More than 5 years have passed since last update.

gem install mysql2のエラー対応

Last updated at Posted at 2019-04-17

macでローカル環境を作るときに出やすいエラー

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

ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen

対応

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
$ sudo chown -R (ユーザ名):staff /Users/(ユーザ名)/.rbenv
$ bin/bundle config --local build.mysql2 "--with-cppflags=-I/usr/local/opt/openssl/include"
$ bin/bundle install --path vendor/bundle
0
1
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
1