使用 mysql2 gem 将 ruby​​ 附加到 mysql 时遇到问题

发布于 2025-01-18 13:09:01 字数 548 浏览 1 评论 0原文

  • Rails版本6.0.4.6
  • Ruby版本2.7.5p203
  • MySQL版本8
  • OS窗口10

我在获得MySQL2 GEM的问题。我遇到的最新错误是无法找到“ mysql2 x64-mingw32”文件。我使用此命令安装了GEM:

gem install mysql2 --platform=ruby -- --with-mysql-dir="C:\Program Files\MySQL\Connector C++ 8.0"
--with_mysql-lib="C:\Program Files\MySQL\Connector C++ 8.0\lib64" --with_mysql_include="C:\Program Files\MySQL\Connector C++ 8.0\include"

它似乎已正确安装,但仍然无法使用。我已经运行捆绑包。我还尝试过删除gem.lock文件和运行捆绑包的安装。

如果有人成功地让Ruby在Windows机器上与MySQL一起工作,请让我知道您的工作方式。

  • Rails version 6.0.4.6
  • Ruby Version 2.7.5p203
  • mySql version 8
  • OS Window 10

I am having issues getting the mysql2 gem to work. The latest error I have is not being able to locate "mysql2 x64-mingw32" file. I installed the gem using this command:

gem install mysql2 --platform=ruby -- --with-mysql-dir="C:\Program Files\MySQL\Connector C++ 8.0"
--with_mysql-lib="C:\Program Files\MySQL\Connector C++ 8.0\lib64" --with_mysql_include="C:\Program Files\MySQL\Connector C++ 8.0\include"

It appears to have been installed correctly but still will not work. I have run bundle install. I have also tried deleting the gem.lock file and the running bundle install.

If anyone has had success in getting ruby to work with MySQL on a Windows machine, please let me know how you did it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相思故 2025-01-25 13:09:01

经过许多步道,看来Ruby在Windows操作系上的表现不佳。虽然我希望有些人确实在窗户上使用Ruby,但似乎缺乏支持,社区很小。

我在机器上安装了Linux终端,运气好多了。

只是张贴以防止其他人拉出头发。

After many trails, it appears the Ruby just doesn't play well with Windows OS. While I expect that some do use Ruby on Windows, it appears the support is lacking, and the community is small.

I installed a Linux terminal on my machine and had much better luck.

Just posting to keep other from pulling their hair out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文