Skip to content
KAllan357 edited this page Dec 5, 2012 · 1 revision

If gem install mysql2 gives you output that looks like:

/Users/kallan/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/ruby/ruby.h:108: error: size of array ‘ruby_check_sizeof_long’ is negative
/Users/kallan/.rvm/rubies/ruby-1.9.2-p318/include/ruby-1.9.1/ruby/ruby.h:112: error: size of array ‘ruby_check_sizeof_voidp’ is negative

You need to install a 64 bit version of MySQL. I followed the steps found here

If you then receive an error that looks like:

/Users/kallan/src/motherbrain/lib/mb/plugin.rb:30:in `eval': dlopen(/Users/kallan/.rvm/gems/ruby-1.9.2-p318/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Users/kallan/.rvm/gems/ruby-1.9.2-p318/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/kallan/.rvm/gems/ruby-1.9.2-p318/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle

You need to do what one of the comments in that StackOverflow says:

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

Clone this wiki locally