使用 mysql2 gem 将 ruby 附加到 mysql 时遇到问题
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过许多步道,看来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.