Black ribbon bottom left

Using MySQL with Rails 3 on Windows

gem mysql2 ไม่ support mysql 64 bits ???

ลง mysql connector 32 bits

    http://dev.mysql.com/downloads/connector/c/


แล้วก็ ...


    gem install mysql2 -- '--with-mysql-lib="C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib" --with-mysql-include="C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include"


แล้วก็ ...

copy libmysql.dll จาก C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib ไปไว้ที่ C:\Ruby193\bin นะจ๊ะ

Using MySQL with Rails 3 on Windows

    Install railsinstaller -> www.railsinstaller.org (I installed it to c:\Rails)

    Install MySQL (I used MySQL 5.5) -> dev.mysql.com/downloads/installer/

    --- for mySQL installation ---

    If you dont already have these two files installed you might need them to get your MySQL going

    vcredist_x86.exe -> http://www.microsoft.com/download/en/details.aspx?id=5555 dotNetFx40_Full_x86_x64.exe -> http://www.microsoft.com/download/en/details.aspx?id=17718

    Use default install Developer Machine

    -MySQL Server Config-
    port: 3306
    windows service name: MySQL55
    mysql root pass: root (you can change this later)
    (username: root)
    -MySQL Server Config-

    --- for mySQL installation ---

    --- Install the mysql2 Gem ---

    Important: Do this with Git Bash Command Line(this was installed with railsinstaller) -> start/Git Bash

    gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.5\lib" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.5\include"'

    Now the gem should have installed correctly

    Lastly copy the libmysql.dll file from
    C:\Program Files\MySQL\MySQL Server 5.5\lib
    to
    C:\Rails\Ruby1.9.2\bin

    --- Install the mysql2 Gem ---




http://stackoverflow.com/questions/3608287/error-installing-mysql2-failed-to-build-gem-native-extension