Project

General

Profile

Error installing Redmine (cannot load such file -- mysql2/mysql2)

Added by System Administrator over 10 years ago

Hello!

Initially tried on a 32-bit OS CentOS 6.4, now trying to install on 64-bit CentOS 6.4

The error occurs in the command:

# rake generate_secret_token
rake aborted!
cannot load such file -- mysql2/mysql2
/var/lib/redmine/config/application.rb:7:in `<top (required)>'
/var/lib/redmine/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

Actually seems to be all installed correctly:

# gem list

*** LOCAL GEMS ***

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
builder (3.0.4, 3.0.0)
bundler (1.3.5)
coderay (1.0.9)
erubis (2.7.0)
hike (1.2.3)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.0.3)
json (1.8.0)
mail (2.5.4)
mime-types (1.23)
multi_json (1.7.8)
mysql (2.9.1)
mysql2 (0.3.13)
net-ldap (0.3.1)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack-openid (1.3.1)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
rake (10.1.0)
rdoc (3.12.2)
rmagick (2.13.2)
ruby-openid (2.1.8)
sprockets (2.2.2)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.14)
tzinfo (0.3.37)

# ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

# gem --version
1.8.25

#  rails -v
Rails 3.2.13

Here is the command which collapses with the trace:

# rake generate_secret_token --trace
rake aborted!
cannot load such file -- mysql2/mysql2
/usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `require'
/usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `<top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/var/lib/redmine/config/application.rb:7:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
/var/lib/redmine/Rakefile:5:in `<top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'

Tell me where to dig out what the problem might be?

PS Sorry for my English!


Replies (4)

RE: Error installing Redmine (cannot load such file -- mysql2/mysql2) - Added by Pieter Van der Meersch over 10 years ago

I had the same issue

I believe that what solved the issue for me was to remove all the gems, then install bundler via yum (yum install rubygem-bundler)
then run 'bundle install --without development test' again.

Not sure this did the trick though, had several issues

RE: Error installing Redmine (cannot load such file -- mysql2/mysql2) - Added by Home chee over 10 years ago

I had the exactly same issue.

the version:

#ruby -v
ruby 2.0.0p247 (2013-06-27) [x86_64-linux]

#gem -v
1.8.25

#rails -v
Rails 3.2.15

and it is on Ubuntu OS.

I didn't know what the problem is and how to solve it.
Maybe there are some problems with the mysql installing? I'm not sure.

have you got the problem solved now?

RE: Error installing Redmine (cannot load such file -- mysql2/mysql2) - Added by Yusuke Masuda over 10 years ago

I got an error same as that.

I'm using AWS (Amazon Linux 2013.09 64bit)

the versions of my env are below:

  1. ruby -v
    ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
  1. gem --version
    1.8.23
  1. rails -v
    Rails 3.2.13

Could anyone can resolve this issue post this thread, please.

RE: Error installing Redmine (cannot load such file -- mysql2/mysql2) - Added by Yusuke Masuda over 10 years ago

I resolved my problem by referring a page below:
http://stackoverflow.com/questions/8707293/rails-3-no-such-file-to-load-mysql2-mysql2-in-production

It seems mysql2 libs installed wrong place.
You will get it, after reinstall mysql2.

Could you try this way.
I hope this will answer your needs.

Best Regard.

    (1-4/4)