This error used to come when you are trying to do bundle install and mysql2 gem is unable to install properly. So below are the steps as per the different operating systems:
Sometimes you need to update your Ruby library, run this code:
Step 1: sudo gem update --system
Step 2: sudo apt-get install build-essential
After these two steps you have to install libmysqlclient-devel:
CentOS/Fedora:
yum install -y libmysqlclient-devel
Ubuntu:
apt-get install -y libmysqlclient-dev
Mac:
brew install mysql
Windows:
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
At Last copy the libmysql.dll file from
C:\Program Files\MySQL\MySQL Server 5.5\lib
to
C:\Rails\Ruby1.9.2\bin
Hope it helps.
0 Comment(s)