Re: error: cannot run hooks/pre-receive: No such file or directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 30, 2011 at 03:27:14PM +0200, Mathieu Malaterre wrote:

> $ git push
> Counting objects: 5, done.
> Delta compression using up to 4 threads.
> Compressing objects: 100% (3/3), done.
> Writing objects: 100% (3/3), 304 bytes, done.
> Total 3 (delta 2), reused 0 (delta 0)
> error: cannot run hooks/pre-receive: No such file or directory
> To ssh://malat@xxxxxxxxxxxxxxxxxxxxxxxx/gitroot/gdcm/gdcm.old
>  ! [remote rejected] master -> master (pre-receive hook declined)
> error: failed to push some refs to
> 'ssh://malat@xxxxxxxxxxxxxxxxxxxxxxxx/gitroot/gdcm/gdcm.old'

We won't try to execute a hook that doesn't exist, so the "no such file
or directory" almost certainly means the #! interpreter is missing.

> I tried with something as simple as :
> 
> % cat pre-receive
> #!/usr/bin/ruby
> % which ruby
> /usr/bin/ruby

This might be a stupid question, but which machine is that output from?
The pre-receive hook runs on the server, so you must have ruby there. I
ask mainly because I didn't realize sourceforge would give people
arbitrary shell access on the git boxes.

My next guess would be that the git process runs in some kind of chroot
that doesn't have ruby in it.

> Do I need to do something special with ruby ?

>From git's perspective, no, but it may depend on how the server is
configured.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]