1
votes

Hello i am having trouble installing mysql2 gem. The first error i was getting was mysql client is missing. I have fixed this with the following

gem install mysql2 -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Server 5.7"'

I then get the message that is missing mysql.h

gem install mysql2 -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Server 5.7" --with-mysql-config="C:\Program Files\MySQL\MySQL Server 5.7\bin"'

I have tried \bin and \include \lib. i have tried different permutation of the last with-mysql to try and find the mysql.h and have been unsuccessful.

Any help will be greatly appreciated.

Thanks.

Not sure if this info is needed but just in case.

Gem --v is 2.2.3

Rails -v is 4.2.5

Ruby -v is 2.1.5p273 [i386-mingw32]

MySQL server version 5.7.9

1
Found the fix-- 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 - Domaa

1 Answers

2
votes

Use this version

gem 'mysql2', '~> 0.3.19'