ruby on rails - mysql2 gem is not compatible with mysql 5.6.19 -


this question has answer here:

i want run rails application on mac osx 10.9.3 , got following error:

/users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `require': incorrect mysql client library version! gem compiled 5.5.23 client library 5.6.19. (runtimeerror)     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `<top (required)>'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `each'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `block in require'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `each'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `require'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler.rb:132:in `require'     /users/home/workspace/rubyonrails/simple_cms/config/application.rb:7:in `<top (required)>'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:79:in `require'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:79:in `block in server'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `tap'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `server'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'     /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'     bin/rails:8:in `require'     bin/rails:8:in `<main>' 

i installed mysql hombrew , it's working perfectly. use rbenv.

gem 'rails', '4.1.1' gem 'mysql2' 

and databas.yml file

development:   adapter: mysql2   encoding: utf8   database: simple_cms_development   pool: 5   username: root   password: somepassword   socket: /tmp/mysql.sock  test:   adapter: mysql2   encoding: utf8   database: simple_cms_test   pool: 5   username: root   password: somepassword   socket: /tmp/mysql.sock  production:   adapter: mysql2   encoding: utf8   database: simple_cms_production   pool: 5   username: root   password: somepassword   socket: /tmp/mysql.sock 

how can solve it?

headers

i going suggest using mysql c-connector (the recommended answer in comments confirmed this)

we've written tutorial on how (for typical unable build native extensions error), same idea

--

c-connector

basically, gem needs interface system; doesn't need need buy send queries & process responses db

this means if have problem mysql version's compatibility, you'll best installing & using separate batch of header files (for gem):

the way download & install mysql c-connector files - important - 32 bit version (you can either use installer or unzip files)

once installed, should install gem following command:

gem install mysql2 --platform=ruby -- ‘--with-mysql-dir="your_mysql_dir”’

this should install gem you, allow interface mysql server


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -