Could not load such file mysql2/mysql2
Added by kevin deng over 10 years ago
Dears,
I got a issue during the installation of redmine.
OS : x86_64 GNU/Linux
ruby 2.0.0p247
redmine 2.3.2
mysql 5.6.17
rails: 3.2.13
I have passed the bundle install and no error, but when i run "rake generate_secret_token", i got below error.
/usr/local/redmine # rake generate_secret_token --trace
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /var/dev/gruntsample/node_modules/phantomjs/bin in PATH, mode 040777
rake aborted!
LoadError: cannot load such file -- mysql2/mysql2
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `<top (required)>'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
/usr/local/redmine/config/application.rb:7:in `<top (required)>'
/usr/local/ruby/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
/usr/local/ruby/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
/usr/local/redmine/Rakefile:5:in `<top (required)>'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/rake_module.rb:28:in `load'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/rake_module.rb:28:in `load_rakefile'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/application.rb:683:in `raw_load_rakefile'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/application.rb:94:in `block in load_rakefile'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/application.rb:93:in `load_rakefile'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/application.rb:77:in `block in run'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/lib/rake/application.rb:75:in `run'
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/rake-10.3.1/bin/rake:33:in `<top (required)>'
/usr/local/ruby/bin/rake:23:in `load'
/usr/local/ruby/bin/rake:23:in `<main>'
Could anyone help me with this? thanks in advance.
Cheers
Kevin
Replies (3)
RE: Could not load such file mysql2/mysql2 - Added by Rupesh Helwade over 10 years ago
Is MYsql2 Gem installed ?
See typing Gem list on command prompt
RE: Could not load such file mysql2/mysql2 - Added by kevin deng over 10 years ago
Dear Helwade,
I have installed mysql2 gem with
gem install mysql2 v '0.3.14' --platform=ruby - --with-mysql-lib=/usr/lib64/mysql
multi_json (1.9.2)
mysql (2.9.1, 2.8.1)
mysql2 (0.3.14)
net-ldap (0.3.1)
nokogiri (1.5.11)
polyglot (0.3.4)
and then the mysql2.so has generated, but later i got another issues like below when using : "rake generate_secret_token"
/usr/local/ruby/lib/ruby/gems/2.0.0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require': /usr/local/ruby/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.so: undefined symbol: __cxa_pure_virtual - /usr/local/ruby/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.so (LoadError)
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `<top (required)>'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /usr/local/redmine/config/application.rb:7:in `<top (required)>'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /usr/local/ruby/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
cheers
Kevin
RE: Could not load such file mysql2/mysql2 - Added by Alexandre Gomes over 10 years ago
Dears,
My name is Alexandre Gomes from Brazil.
I have same problem in Fedora 20.
Best Regards