rubygems - GitLab sidekiq 测试失败

标签 rubygems rake gitlab

我按照此处的说明进行操作:

https://github.com/gitlabhq/gitlabhq/blob/4-1-stable/doc/install/databases.md

当我尝试运行测试时:

sudo -u gitlab -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production

第一个测试返回橙色标题,第二个测试显示 Sidekiq 错误:

Checking Sidekiq ...    

Running? ... no
  Try fixing it:
  sudo -u gitlab -H bundle exec rake sidekiq:start
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  see log/sidekiq.log for possible errors
  Please fix the error above and rerun the checks.
Checking Sidekiq ... Finished

当我运行 sudo -u gitlab -H bundle exec rake sidekiq:start 时,出现以下错误:

rake aborted!
cannot load such file -- rb-inotify
/home/gitlab/gitlab/config/application.rb:9:in `<top (required)>'
/home/gitlab/gitlab/Rakefile:5:in `require'
/home/gitlab/gitlab/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

当我运行跟踪时,我得到以下输出:

rake aborted!
cannot load such file -- rb-inotify
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2     levels) in require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
/home/gitlab/gitlab/config/application.rb:9:in `<top (required)>'
/home/gitlab/gitlab/Rakefile:5:in `require'
/home/gitlab/gitlab/Rakefile:5:in `<top (required)>'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bin/rake:23:in `load'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bin/rake:23:in `<main>'

我已经尝试手动安装 rb-inotify 来纠正该问题:

sudo gem install rb-inotify

说成功了,但是测试还是不行!请指教!谢谢

最佳答案

那种命令:

 sudo -u gitlab -H bundle exec rake sidekiq:start

不仅需要在 gitlab 克隆的存储库中运行,还需要 RAILS_ENV=product 才能正常运行:

 sudo -u gitlab -H bundle exec rake sidekiq:start RAILS_ENV=production

参见troubleshooting page :

  • Error: no such file to load -- rb-inotify when running rake (as seen in #1752)
  • Problem: task run in wrong environment
  • Solution: add RAILS_ENV=production to the end of the command

关于rubygems - GitLab sidekiq 测试失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14734968/

相关文章:

ruby-on-rails - jekyll 主题不会更新,没有错误,页面呈现为 'minima'

Gitlab 提交消息

ruby-on-rails - 佣金 Assets 之间的差异 :precompile:all and rake assets:precompile:primary

ruby-on-rails - rake db :migrate the correct command to re-sync schema. rb 是否与您的数据库架构一起使用?

git - 如何为两个 GitLab 帐户设置两个 SSH key 并使用 TortoiseGit 进行推送/pull ?

kubernetes - 从 CI 将应用程序部署到 gke

ruby - 将 gems 解包/卡住到非 Rails ruby​​ 应用程序中

ruby - 将 `gem ' pg'` 添加到您的 Gemfile 并确保其版本处于 ActiveRecord 所需的最低版本

mysql - 将邮件消息解析为ruby中的数据库

ruby-on-rails-3 - 在 Rails 应用程序的 Rake 任务中删除表