# How to debug failing Kernel.system call

**URL:** <https://www.ruby-forum.com/t/how-to-debug-failing-kernel-system-call/120010>\
**Category:** Ruby\
**Created:** [November 12, 2007, 10:36pm UTC](https://www.ruby-forum.com/t/how-to-debug-failing-kernel-system-call/120010 "2007-11-12T22:36:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Post date:** [November 12, 2007, 10:36pm UTC](https://www.ruby-forum.com/t/how-to-debug-failing-kernel-system-call/120010/1 "2007-11-12T22:36:51Z")

</div>

Hi folks. I’ve got a simple Kernel.system call which is failing:

system(‘svn’, ‘commit’, ‘-q’, ‘–non-interactive’, ‘–message’, ‘File  
updated by dball’, ‘reports/2007-11-11.txt’)

with exit code 256. When I run this from the command line, wrapping the  
final two parameters in double quotes, it runs fine. Any suggestions for  
what I may be doing wrong or where to look for debugging inspiration?

I’m on a win32 box, fwiw, running ruby-1.8.5. Do I need to be manually  
quoting the parameters to system? (Docs and previous experience suggest  
not, but I’ve been wrong before.)

- donald

---

<div class="post-metadata">

**Author:** ![BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Post date:** [November 13, 2007, 2:05pm UTC](https://www.ruby-forum.com/t/how-to-debug-failing-kernel-system-call/120010/2 "2007-11-13T14:05:26Z")

</div>

On Nov 12, 11:31 pm, “Ball, Donald A Jr (Library)”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi folks. I’ve got a simple Kernel.system call which is failing:
> 
> system(‘svn’, ‘commit’, ‘-q’, ‘–non-interactive’, ‘–message’, ‘File updated by dball’, ‘reports/2007-11-11.txt’)
> 
> with exit code 256. When I run this from the command line, wrapping the final two parameters in double quotes, it runs fine. Any suggestions for what I may be doing wrong or where to look for debugging inspiration?
> 
> I’m on a win32 box, fwiw, running ruby-1.8.5. Do I need to be manually quoting the parameters to system? (Docs and previous experience suggest not, but I’ve been wrong before.)

Try to examine stderr output. Plus try to enclose the parameters with  
spaces in double quotes–it’s Windows anyway, so who knows, it might  
work that way. 😉

---

<div class="post-metadata">

**Author:** ![BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Post date:** [November 13, 2007, 11:21pm UTC](https://www.ruby-forum.com/t/how-to-debug-failing-kernel-system-call/120010/3 "2007-11-13T23:21:46Z")

</div>

> > I’m on a win32 box, fwiw, running ruby-1.8.5. Do I need to  
> > be manually  
> > quoting the parameters to system? (Docs and previous experience  
> > suggest not, but I’ve been wrong before.)
> 
> Try to examine stderr output. Plus try to enclose the  
> parameters with spaces in double quotes–it’s Windows anyway,  
> so who knows, it might work that way. 😉

I’ve switched to using the single argument version of system doing my  
own quoting of parameters with spaces, and I continue to get a failing  
error code. Here’s what I’m doing now:

system(“svn commit --non-interactive --message “File added by dball””)

after changing pwd to the root of the folder in which the svn repository  
is checked out. Stderr reports:

svn: Commit failed (details follow):  
svn: Unable to open an ra\_local session to URL  
svn: Unable to open repository  
‘file:///z:/techserv/svn/intranet-files/reports’

The true svn repository is at file:///z:/techserv/svn/intranet-files,  
while the file I added is in the reports directory.

I’d submit that this has nothing to do with ruby but for the fact that  
when I run that command string from the win32 command shell, it works as  
expected. I’m pretty much at a loss now, so if anyone has any  
suggestions, no matter how bizarre, I’m all ears.

- donald

---

<div class="post-metadata">

**Author:** ![BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/da6949/32.png) [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Post date:** [November 14, 2007, 1:40pm UTC](https://www.ruby-forum.com/t/how-to-debug-failing-kernel-system-call/120010/4 "2007-11-14T13:40:46Z")

</div>

On Nov 14, 12:20 am, “Ball, Donald A Jr (Library)”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’d submit that this has nothing to do with ruby but for the fact that  
> when I run that command string from the win32 command shell, it works as  
> expected. I’m pretty much at a loss now, so if anyone has any  
> suggestions, no matter how bizarre, I’m all ears.

Try to check environment variables–do you get the same in  
Kernel#system as when command running from shell?
