Sidekiq没有在GitLab 6.0.0安装上运行

时间:2013-08-22 02:54:07

标签: bundler gitlab sidekiq

我按照说明安装了GitLab 6.0.0:https://github.com/gitlabhq/gitlabhq/blob/6-0-stable/doc/install/installation.md

当我进入“检查应用程序状态”并运行

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

我看到“ Bundler版本:未知”:

System information
System:         Ubuntu 12.04
Current User:   git
Using RVM:      no
Ruby Version:   1.9.3p0
Gem Version:    1.8.11
Bundler Version:unknown
Rake Version:   10.1.0

GitLab information
Version:        6.0.0
Revision:       5246d63
Directory:      /home/git/gitlab
DB Adapter:     mysql2
URL:            http://my-server
HTTP Clone URL: http://my-server/some-project.git
SSH Clone URL:  git@my-server:some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        1.7.0
Repositories:   /home/git/repositories/
Hooks:          /home/git/gitlab-shell/hooks/
Git:            /usr/bin/git

bundle --versionsudo -u git -H bundle --version都显示 1.3.5 ,所以我不确定为什么上面的命令会显示“未知”......

...所以我继续运行sudo service gitlab start并且说“GitLab服务已启动”,但似乎并非如此,因为sudo service gitlab status说“GitLab服务未运行“和/home/git/gitlab/tmp/pids为空但有权限:”drwxr-xr-x“表示用户和组”git“。

axilleas设法通过创建目录来解决这个问题,但这不是我的问题。

......我可能不应该期望它可以在这里工作,但无论如何我都会继续,但现在它抱怨 sidekiq

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

Checking Environment ...

Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.0 ? ... OK (1.7.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ... can't check, you have no projects

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... no
  Try fixing it:
  sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
  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

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... /home/git/gitlab/vendor/bundle/ruby/1.9.1/bin/rake: No such file or directory - bundle exec rake db:migrate:status
yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)

Checking GitLab ... Finished

adril遇到过这个问题(但他的捆绑工作正常)。他遵循这个建议,但由于某种原因,他的日志文件比我的更多信息 - 我只有一行:

  

nohup:无法运行命令`bundle':没有这样的文件或目录

...也许这与“没有这样的文件或目录 - 捆绑exec rake db:migrate:status ”这一行有关吗?

不,我认为一个人可以安全地忽略吗? - 这没关系:sudo -u git -H bundle exec rake db:migrate:status RAILS_ENV=production

编辑: 当我运行echo $PATH时,我看到/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

我在lib / tasks / gitlab / info.rake中添加了一些日志记录,结果发现gitlab使用了不同的路径:

/home/git/gitlab/vendor/bundle/ruby/1.9.1/bin:/usr/bin:/bin:/usr/sbin:/sbin

包安装在/usr/local/bin

4 个答案:

答案 0 :(得分:2)

我不确定问题存在的原因,也不知道如何在代码中修复它,但是有一个简单的解决方法:

sudo ln -s /usr/local/bin/bundle /usr/bin/bundle

答案 1 :(得分:0)

您可以尝试在git用户中运行失败的命令吗?我的意思是:

su
su - git
cd gitlab/
run commands..

也许sudo正在改变你所描述的here路径。所以如果我是你,我会尝试再次安装bundler,然后检查上面的答案(如果这是你的情况)。

答案 2 :(得分:0)

visudo命令
默认值为secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9 0.3-P392 @全球/ bin中:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin

答案 3 :(得分:0)

我知道这已经过时了,但是我要添加一些信息,因为我在FreeBSD上运行了一个gitlab,我不得不改变一些事情。 也许这对任何寻找解决方案的人都很有用,就像我一样。

对我来说,Sidekiq问题是由check.rake中的错误命令引起的。 该脚本使用ps ux,如果输出太长,它将修剪输出。 脚本(在我当前版本中)通过正则表达式检查它,并且 我的ps显示过程为" ruby​​20:sidekiq 2.x.x&#34 ;, ps ux输出被切换到sidekiq。 这也将在Linux上触发。 解决方案 - 添加" w" ps的参数,如:

 Gitlab::Popen.popen(%W(ps wux)
如果您将其安装在不同的目录中,则

初始化脚本检查将失败,例如我把它作为/usr/local/etc/rc.d/gitlab。 omn​​ibus有一个script_path条目,而非omnibus。