I cant run a Rails project because of the error occurred in mysql2
This post didn't help me: rake aborted! uninitialized constant Mysql2
Also it works fine on my co-workers computers, so an issue with the project itself is excluded.
Here is the console output:
$ rails s
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'mysql2'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant Mysql2::Client::SECURE_CONNECTION
Backtrace for gem load error is:
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2/client.rb:12:in `<class:Client>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2/client.rb:2:in `<module:Mysql2>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2/client.rb:1:in `<top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2.rb:10:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2.rb:10:in `<top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
/home/duke/RubymineProjects/*******/*******/config/application.rb:7:in `<top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `block in <top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
Bundler Error Backtrace:
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /home/duke/RubymineProjects/********/********/config/application.rb:7:in `<top (required)>'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've tried every single advice from GitHub Issues, but it didn't help at all.
- I tried Ruby 2.0.0, 2.1.8, 2.2.x
- My OS is Ubuntu 16.04
- MySQL 5.6.16
ruby-mysql
andlibmysqlclient-dev
are both installed