2013-10-18 14 views
5

Prima di utilizzare gitlab 5.3 e tutto funziona correttamente.Gitlab 6.1 push Respinto/Errore

Ora aggiorno a gitlab 6.1 tramite 5.4 e 6.0 e ora non riesco a spingere.

controllo di installazione sul server:

[email protected]:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production 

System information 
System:  Debian 6.0.7 
Current User: git 
Using RVM: no 
Ruby Version: 1.9.3p327 
Gem Version: 2.1.8 
Bundler Version:1.3.5 
Rake Version: 10.1.0 

GitLab information 
Version: 6.1.0 
Revision: b595503 
Directory: /home/git/gitlab 
DB Adapter: mysql2 
URL:  http://git.gigadi.org 
HTTP Clone URL: http://git.gigadi.org/some-project.git 
SSH Clone URL: [email protected]:some-project.git 
Using LDAP: no 
Using Omniauth: no 

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



[email protected]:/home/git/gitlab# 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.1 ? ... OK (1.7.1) 
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 
update hook up-to-date? ... yes 
update hooks in repos are links: ... 


Checking GitLab Shell ... Finished 

Checking Sidekiq ... 

Running? ... yes 

Checking Sidekiq ... Finished 

Checking GitLab ... 

Database config exists? ... yes 
Database is SQLite ... no 
All migrations up? ... 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 namespace: ... 

Projects have satellites? ... 

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 

Quando provo a mia macchina locale:

GIT_SSH='ssh -v' git push -f http://mydomain.org/xxx/xxx.git master 

Il risultato è:

Counting objects: 154, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (135/135), done. 
Writing objects: 100% (154/154), 184.75 KiB, done. 
Total 154 (delta 22), reused 0 (delta 0) 
remote: /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/dsl.rb:33:in `eval_gemfile': Gemfile syntax error: (Bundler::GemfileError) 
remote: /home/git/gitlab/Gemfile:14: syntax error, unexpected ':', expecting $end 
remote: gem "mysql2", group: :mysql 
remote:     ^
remote:  from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/dsl.rb:9:in `evaluate' 
remote:  from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/definition.rb:19:in `build' 
remote:  from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition' 
remote:  from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:116:in `setup' 
remote:  from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17 
remote: error: hook declined to update refs/heads/master 
To http://mydomain.org/xxx/xxx.git 
! [remote rejected] master -> master (hook declined) 
error: failed to push some refs to 'http://mydomain.org/xxx/xxx.git' 

Io uso gitlab in Debian 6.0.7 con apache

Dov'è il problema?

risposta

12

ho risolvere il mio problema in questo modo:

vim /home/git/gitlab-shell/hooks/update 

cambiamento prima linea da

#!/usr/bin/env ruby 

PER

#!/usr/local/bin/ruby 

Ora la mia spinta funzionano bene!

Pensa VonC

+0

Grande feedback.+1 – VonC

+0

sì uomo, ha funzionato anche per me! – soupdiver

+0

grazie per il suggerimento. Sto usando RVM per git per avere un env Ruby separato. Il mio hashbang è '#!/Home/git/.rvm/rubies/ruby-2.1.1/bin/ruby' – stwienert

2

In primo luogo, spingendo con un URL HTTP significa ssh non è coinvolto a tutti:

  • Impostazione GIT_SSH non fa alcuna differenza.
  • L'impostazione GIT_CURL_VERBOSE=1 farebbe la differenza nell'output dello git push.

In secondo luogo, come illustrato da issue 3373, issue 2285, issue https://github.com/gitlabhq/gitlabhq/issues/3349, ... è una questione di versione rubino.

sono sicuro al 99% che avete 1.9.3 installato da RVM ma avete anche il sistema rubino (check /usr/bin/ruby --version).
Quando ci si connette attraverso [email protected] (SSH) - si stanno lanciando guscio in modo rvm viene inizializzato correttamente e usato e tutto funziona, ma quando si esegue tramite HTTP, gitlab lancia gitlab-shell direttamente e per qualche motivo rvm non funziona e la la versione di sistema viene utilizzata.

1

ho risolto il mio problema, come ha detto Ramazan sopra vim/home/git/gitlab-shell/ganci/aggiornamento cambiare prima linea da

!/Usr/bin/env rubino

PER

!/usr/local/bin/ruby ​​

Problemi correlati