I cloned the github repo https://github.com/8bitpal/hackful, run 'bundle install' and now 'rake db:create'. But I get an error message:
Incorrect MySQL client library version! This gem was compiled for 5.0.45 but the client library is 5.5.15.
Tried to find out more infos about my mysql setup:
$ mysql_config --version
$ 5.0.45
$ mysql
$ mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 5.1.57 |
+-----------+
Since I rarely do sysadmin stuff I feel a bit lost how to interpretate this info, i.e. why is the "client library 5.5.15" mentioned, is that kind of a minimum version mysql version when using the mysql2 gem?
Anyhow, I did some more research on SO and found this thread Ruby mysql2 gem compiled for wrong mysql client library version. The question is similar to mine:
After updating MySQL to 5.5 using apt-get, the mysql2 gem stopped working.
Here's the error:
Incorrect MySQL client library version! This gem was compiled for 5.5.17 but the client library is 5.1.58. (RuntimeError)
The answer in that thread:
I have encounter the same error when using Ubuntu Server 11.04 and Percona Server, what have I done was:
replace /usr/lib/libmysqlclient.so.16.0.0 with /usr/lib/libmysqlclient.so.18.0.0
Problem in my case is that I don't have such a file:
ls /usr/lib/mysql
libdbug.a libmyisam.a libmysqlclient.a libmysqlclient_r.a libmystrings.a libvio.a
libheap.a libmyisammrg.a libmysqlclient.la libmysqlclient_r.la libmysys.a
Most other threads with a similar topic are about Windows, but I'm on OS X. Any ideas what can I try next? More infos about my setup: OS X Lion, rvm, Rails 3.1.3, ruby 1.9.2p290. Gem list:
*** LOCAL GEMS ***
actionmailer (3.1.3)
actionpack (3.1.3)
activemodel (3.1.3)
activerecord (3.1.3)
activeresource (3.1.3)
activesupport (3.1.3)
addressable (2.2.7)
arel (2.2.1)
bcrypt-ruby (3.0.1)
builder (3.0.0)
bundler (1.0.21)
cancan (1.6.5)
capybara (1.1.2)
capybara-webkit (0.10.1)
childprocess (0.3.0)
coderay (1.0.5)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
cucumber (1.1.4)
cucumber-rails (1.2.1)
database_cleaner (0.7.1)
delayed_job (3.0.0)
delayed_job_active_record (0.3.1)
devise (2.0.0)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.3.0)
factory_girl (2.6.3)
factory_girl_rails (1.7.0)
faker (1.0.1)
fakeweb (1.3.0)
ffi (1.0.11)
fileutils (0.7)
gherkin (2.7.6)
growl (1.0.3)
guard (1.0.3)
guard-bundler (0.1.3)
guard-cucumber (0.7.5)
guard-rspec (0.7.2)
guard-spork (0.8.0)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.19)
json (1.6.5)
launchy (2.0.5)
libv8 (3.3.10.4 x86_64-darwin-11)
mail (2.3.0)
make_voteable (0.1.1)
method_source (0.7.1)
mime-types (1.17.2)
multi_json (1.0.4)
mysql (2.8.1)
mysql2 (0.3.11)
nokogiri (1.5.0)
orm_adapter (0.0.6)
polyglot (0.3.3)
pry (0.9.8.4)
rack (1.3.6)
rack-cache (1.1)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.3)
rails_autolink (1.0.5)
railties (3.1.3)
rake (0.9.2.2)
rb-fsevent (0.9.1)
rdiscount (1.6.8)
rdoc (3.12)
rest-client (1.6.7)
rmagick (2.13.1)
rspec (2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
rspec-mocks (2.8.0)
rspec-rails (2.8.1)
rubyzip (0.9.5)
sass (3.1.12)
sass-rails (3.1.5)
selenium-webdriver (2.18.0)
slop (2.4.4)
spork (0.9.2)
sprockets (2.0.3)
sqlite3 (1.3.5)
term-ansicolor (1.0.7)
therubyracer (0.9.9)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31)
uglifier (1.2.2)
warden (1.1.0)
xpath (0.1.4)
Update I checked what homebrew installed for mysql. When I understood it correct, this should be the mysql client library version:
$ ls /usr/local/Cellar/mysql
$ 5.5.15
Now I need to get the mysql_config updated to 5.5.15?
Update 2 Solved. This one did the trick:
gem install mysql2 -- --with-mysql-config=/usr/local/Cellar/mysql/5.5.15/bin/mysql_config
Source: Install the mysql2 gem for a specific mysql client version?
Had this problem after upgrading packages in homebrew. The mysql2 gem simply needs to be told to re-compile its non-ruby components.
Assuming homebrew is set up correctly, the following should fix the problem:
gem uninstall mysql2
gem install mysql2 # or bundle install
(depending on your bundler config, you may need to do something more complicated, but this was enough for me)
I have solved the problem based on this tutorial, which helped me installing the correct version of mysql for rails http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With