我想更新Gitlab(6.1到6.3),但在Checkout之后会发生这种情况。
我使用以下命令更新数据库:
ruby bin/rake db:migrate RAILS_ENV=production
我需要知道如何解决问题:
Can't connect to local MySQL server through socket '/home/gitlab/mysql/tmp/mysql.sock' (2)
Systeminfo:
完整输出:
root@j72177:/home/gitlab/apps/gitlab/htdocs# ruby bin/rake db:migrate RAILS_ENV=production
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/gitlab/apps/gitlab/htdocs/Rakefile:7)
rake aborted!
Can't connect to local MySQL server through socket '/home/gitlab/mysql/tmp/mysql.sock' (2)
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/model_schema.rb:224:in `table_exists?'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb:5:in `included'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/taggable.rb:98:in `include'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/taggable.rb:98:in `taggable_on'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/taggable.rb:39:in `acts_as_taggable_on'
/home/gitlab/apps/gitlab/htdocs/app/models/issue.rb:38:in `<class:Issue>'
/home/gitlab/apps/gitlab/htdocs/app/models/issue.rb:20:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:359:in `require_or_load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:502:in `load_missing_constant'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:192:in `block in const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:514:in `load_missing_constant'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:192:in `block in const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:514:in `load_missing_constant'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:192:in `block in const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `const_missing'
/home/gitlab/apps/gitlab/htdocs/lib/api/notes.rb:6:in `<class:Notes>'
/home/gitlab/apps/gitlab/htdocs/lib/api/notes.rb:3:in `<module:API>'
/home/gitlab/apps/gitlab/htdocs/lib/api/notes.rb:1:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/lib/api/api.rb:1:in `block in <top (required)>'
/home/gitlab/apps/gitlab/htdocs/lib/api/api.rb:1:in `each'
/home/gitlab/apps/gitlab/htdocs/lib/api/api.rb:1:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/config/initializers/2_app.rb:13:in `block in <top (required)>'
/home/gitlab/apps/gitlab/htdocs/config/initializers/2_app.rb:13:in `each'
/home/gitlab/apps/gitlab/htdocs/config/initializers/2_app.rb:13:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `block in load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:592:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:592:in `block in <class:Engine>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `instance_exec'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `run'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `run_initializers'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:136:in `initialize!'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/gitlab/apps/gitlab/htdocs/config/environment.rb:5:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:103:in `require_environment!'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
root@j72177:/home/gitlab/apps/gitlab/htdocs#
答案 0 :(得分:1)
您可以针对该错误消息背后的各种常见原因检查“Can't connect to local MySQL server through socket '/path/to/mysql.sock
'”。
该路径已在gitlab/config/database.yml.mysql
文件中配置。
主要是:
sudo chmod -R 755 /home/gitlab/mysql/tmp/mysql
)/etc/mysql/my.cnf
mysql-server
。另请确保遵循migration process:
sudo -u git -H bundle install --without development test postgres --deployment
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production