Rails 5 and Ruby 2.3.3 Failed to load libmysql.dll

无人久伴 提交于 2019-12-06 05:17:36

Downgrading mysql2 rubygem from version 0.4.7 to 0.3.21 solved my issue.

Below steps I followed

rails new blog -d mysql # created application with mysql as database
gem uninstall mysql2 #uninstalled mysql2-0.4.7
Gemfile :
    gem 'mysql2', '0.3.21' #Gemfile changed mysql2 version to 0.3.21
bundle update mysql2 #installed mysql2-0.3.21 version

Just as an update to this thread, specifying the platform of the gem did the job for me;

gem uninstall mysql2
gem install mysql2 --platform=ruby

And here is my version details:

Windows OS
Ruby 2.5.0p0 (2017-12-25 revision 61468) [i386-mingw32]
Rails 5.1.6
Gemfile:
  gem 'mysql2', '0.5.1'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!