Rails 5和Ruby 2.3.3无法加载libmysql.dll [英] Rails 5 and Ruby 2.3.3 Failed to load libmysql.dll

查看:78
本文介绍了Rails 5和Ruby 2.3.3无法加载libmysql.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

启动使用mysql数据库创建的应用程序的服务器时,获取以下错误消息记录在控制台中.

Getting below error message logged in the console while starting the server for an application created with mysql database.

Failed to load libmysql.dll from C:\RailsInstaller\Ruby2.3.0\lib\ruby\gems\2.3.0\gems\mysql2-0.4.7-x86-mingw32\vendor\libmysql.dll

环境详细信息:

Window 7 64 bit
Rails 5.0.4
ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]
mysqld  Ver 5.7.18 for Win64 on x86_64 (MySQL Community Server (GPL))

在控制台上收到以下消息后,收到来自mysql2 ruby​​ gem的安装后消息.

Post install message from mysql2 ruby gem received below message on the console.

You've installed the binary version of mysql2.
It was built using MySQL Connector/C version 6.1.10.
It's recommended to use the exact same version to avoid potential issues.

At the time of building this gem, the necessary DLL files were retrieved from:
http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.10-win32.zip

This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README.

我从这里尝试了该解决方案但不起作用.

任何帮助表示感谢,谢谢.

Any help appreciated, thanks in advance.

推荐答案

将mysql2 ruby​​gem从版本0.4.7降级到0.3.21解决了我的问题.

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

按照我的步骤进行操作

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

这篇关于Rails 5和Ruby 2.3.3无法加载libmysql.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆