11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NameError: uninitialized constant Mysql2::Client::SECURE_CONNECTIONが出た時の対処

Posted at

環境

OS: Mac OS X Yosemite
Ruby: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin14.0]
Mysql: Ver 14.14 Distrib 5.7.11, for osx10.10 (x86_64)

ここら辺参考に

https://github.com/brianmario/mysql2/issues/603
https://github.com/brianmario/mysql2/issues/711
http://qiita.com/miyukiw/items/a0e00028ec5ac5c6beb0

私の環境で解決した事例

上記リンクでmysql2のバージョンを0.3.17へしろと書いてあるけど、
gem install mysql2 -v 0.3.17
ではダメで
Gemfile gem 'mysql2', '~> 0.3.17'
って書いてbundle installでGemfile.lockに適用させなくてはならない

おわりに

蓋を開けてみれば当たり前の話だが、普段から触ってないとふとした時の対処に時間が掛かってしまう。3時間近くグダグダ彷徨ってた。

11
8
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
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?