重装了mysql 后,rails s 出现mysql2的bug
dlopen(/Users/wenyuancheng/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: @rpath/libmysqlclient.21.dylib (LoadError)
Referenced from: /Users/wenyuancheng/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/wenyuancheng/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.bundle
解决方法:
gem pristine mysql2