[英]Cannot install mysql2 gem on Windows 10
我安装了 8.0.30 版本的 mysql 和 ruby v3.0.4。 我可以在我的系统上运行 mysql 并创建数据库,但我无法运行此命令:
gem install mysql2 -v '0.5.4' -- '--with-mysql-lib="C:\Program Files\MySQL\MySQL Server 8.0\lib" --withmysql-include="C:\Program Files\MySQL\MySQL Server 8.0\include"'
我收到以下错误:
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enc_interned_str() in ruby.h... yes
checking for -lmysqlclient... no
-----
mysql client is missing. Check your installation of MySQL or Connector/C, and try again.
-----
*** extconf.rb failed ***
您是否在本地安装了客户端库文件(不仅仅是服务器)?
https://dev.mysql.com/downloads/c-api/
我知道这不是一个直接的解决方案,但我强烈建议您看看在 WSL2 下进行开发。 在本机 Windows 下开发 Ruby 应用程序通常涉及更多关于仅使用 Linux 子系统的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.