mysql2 and redmine 1.1.2

Added by Малъ Скрылёвъ over 10 years ago

Hello, I have a trouble with an installation of mysql2 adapter with the redmine 1.1.2 workign under the passenger 3.0.7.

I've got the following exception from the passenger's log:

[ pid=15657 thr=84390610 file=utils.rb:176 time=2011-05-20 12:11:37.439 ]: *** Exception RuntimeError in PhusionPassenger::ClassicRails::ApplicationSpawner (Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter)) (process 15657, thread #<Thread:0xa0f65a4>):
    from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `rescue in rescue in establish_connection'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:73:in `rescue in establish_connection'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:68:in `establish_connection'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection'
    from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:438:in `initialize_database'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:141:in `process'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:113:in `run'
    from /var/www/www.slavlang.org_ruby1_9/config/environment.rb:41:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/classic_rails/application_spawner.rb:222:in `preload_application'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/classic_rails/application_spawner.rb:181:in `block in initialize_server'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/utils.rb:572:in `report_app_init_status'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/classic_rails/application_spawner.rb:174:in `initialize_server'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/abstract_server.rb:180:in `start'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
    from <internal:prelude>:10:in `synchronize'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/helper-scripts/passenger-spawn-server:102:in `<main>'

I seems that it can't find installed mysql2 adapter and ask to install the adapter as follows:
gem install activerecord-mysql2-adapter

But some of people said that run of the: gem install mysql2 is enough to work with rails (may be do not with redmine). What can I do to allow the adapter work?

This is my mysql2 adapter's place:

ls /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.2/lib/active_record/connection_adapters/
em_mysql2_adapter.rb

My database conf:

# MySQL (default setup).

production:
  adapter: mysql2
  database: redmine1
  host: localhost
  username: redmine
  password: xxxxxxxxxxxxxx
  encoding: utf8

development:
  adapter: mysql2
  database: redmine_development
  host: localhost
  username: redmine
  password: xxxxxxxxxxxxxx
  encoding: utf8

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: redmine_test
  host: localhost
  username: root
  password:
  encoding: utf8

Replies (1)

(1-1/1)