running console commands in rails

Hey,

how can i run console commands form my rails app. I have tried using backticks. eg

result = `svn checkout <url> <path>`

They work fine when i run the sciprt from the command line with

ruby something.rb

but when the same script is run form my rails app nothing happens. It seems the commands are ignored. Does anyone know a different way of doing this with out backticks or a solution for getting around this problem.

Thanks in advance, Stewart

Hey,

how can i run console commands form my rails app. I have tried using backticks. eg

result = `svn checkout <url> <path>`

They work fine when i run the sciprt from the command line with

ruby something.rb

but when the same script is run form my rails app nothing happens. It seems the commands are ignored. Does anyone know a different way of doing this with out backticks or a solution for getting around this problem.

Have you looked at what result is when it doesn't work ? Could it just be that the working directory isn't what you expect it to be and so the checkout happens somewhere else? Another possibility is that the shell spawned to execute your command somehow inherits a different environment (eg $PATH) and so it can't find the svn command.

Fred