升级到7.0后,Gitlab使用mysql2 gem

时间:2014-06-24 07:21:28

标签: ruby gem gitlab mysql2

我将Gitlab升级到版本7.0之后我的mysql2 gem有问题这里是我的错误日志我该怎么办才能修复它?

I, [2014-06-24T06:49:07.574760 #18301]  INFO -- : Refreshing Gem list
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/connection_specification.rb:190:in `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/connection_specification.rb:187:in `spec'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_handling.rb:50:in `establish_connection'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `each'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/railtie.rb:118:in `block in <class:Railtie>'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /usr/local/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
    from /usr/local/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
    from /usr/local/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
    from /usr/local/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
    from /usr/local/lib/ruby/2.0.0/tsort.rb:180:in `each'
    from /usr/local/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
    from /usr/local/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `public_send'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `method_missing'
    from /home/git/gitlab/config/environment.rb:5:in `<top (required)>'
    from config.ru:13:in `require'
    from config.ru:13:in `block in <main>'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from config.ru:1:in `new'
    from config.ru:1:in `<main>'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `eval'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn.rb:48:in `block in builder'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn_rails:139:in `call'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn_rails:139:in `block in rails_builder'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `call'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:722:in `build_app!'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:140:in `start'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `<top (required)>'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `load'
    from /home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `<main>'

1 个答案:

答案 0 :(得分:3)

您必须捆绑安装更新后的依赖项。

bundle install --deployment --without development test postgres aws

这将安装mysql2 gem和其他人。看看他们的精彩文档:https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md