Installing MySQL2 Gem on Windows

前端 未结 1 500
庸人自扰
庸人自扰 2020-12-17 04:19

I was having some issues getting the mysql2 gem to install on my Windows 8.1 machine. I followed the instructions in this post:

Ruby MYSQL2 gem instal

相关标签:
1条回答
  • 2020-12-17 05:08

    When you installed the mysql2, did you download the lib files it needs?


    I've not installed it on Windows 8, but Windows 7 needs to have this file to give mysql the dependencies requires to help it work. You can see various tutorials on how to do this, and I'll outline a simple overview here:

    - Unzip the mysql connector file:

    C:\mysql-connector-c-6.1.3-win32\ (or similar path WITHOUT any spaces)

    - Run the mysql2 gem installer again:

    gem uninstall mydsql
    gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\mysql-connector\lib" --with-mysql-include="C:\mysql-connector\include" --with-mysql-dir="C:\mysql-connector"'
    

    Bottom line is I think your mysql2 gem isn't loading the files it requires to run, and probably doesn't show an error because it's Windows 8

    0 讨论(0)
提交回复
热议问题