I got this error today on my iMac. It was incredibly frustrating and I tried all of the following to fix it (the reason I list them is because I’m not entirely sure the final step I’ll mention at the end was the sole solution).
1. uninstall mysql2 gem (gem uninstall mysql2)
2. uninstall mysql on homebrew (brew uninstall mysql)
3. uninstall mysql-connector-c on homebrew (brew uninstall mysql-connector-c)
4. reinstall mysql on homebrew (brew install mysql)
5. reinstall mysql-connector-c on homebrew (brew install mysql-connector-c)
6. reinstall mysql2 gem (gem install mysql2)
After all that I still got the error… at this point I was about to set my hair on fire, but then I noticed I had receieved a difference error message in my logs…
ActionView::Template::Error (dyld: Library not loaded: /opt/local/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
Do you see that reference to node? WTF!
So then I did the following:
1. uninstall node on homebrew (brew uninstall node)
2. reinstall node on homebrew (brew install node)
WOOHOO! It worked again! My hair is safe and I can stand down from Defcon 1. Why did this happen? I have no idea. Hopefully this helps someone else and please let me know in the comments if you know why this happened.