Forum: Rails deployment Can't execute command via Open3.popen3

19168f90634d83872ca3803b328b3c41?d=identicon&s=25 Peter Marks (petermarks)
on 2010-11-10 04:01
I'm implemented the "Github Hook" redmine plugin. It's supposed to
execute a git command on my server via Open3.popen3 using this method:

def exec(command)  "GithubHook: Executing command: '#{command}'"
  stdin, stdout, stderr = Open3.popen3(command)

  output = stdout.readlines.collect(&:strip)
  errors = stderr.readlines.collect(&:strip)  "GithubHook: Output from git:"  "GithubHook:  * STDOUT: #{output}"  "GithubHook:  * STDERR: #{output}"

However, the command doesn't execute. It does what it's supposed to do
when I execute it manually. Here's the response from the log messages:

GithubHook: Executing command: 'cd '/home/me/repositories/app/.git/' &&
git fetch origin && git reset --soft refs/remotes/origin/master'
GithubHook: Output from git:
GithubHook:  * STDOUT:
GithubHook:  * STDERR:

I've never worked with Open3.popen3 before. What about my environment
(an ubuntu Hardy slice host box) might be preventing execution.

Thanks in advance!

This topic is locked and can not be replied to.