run ruby script.rb from rails

Davis Kitchel wrote:

It looks promising, but I can't get that to work

<% result = `ruby /private/var/www/myapp/script/myscript.rb` %>

Where do you suggest I put that code? And I assume you mean that I do nothing with the result? it just prompts the code to run?   

Everything that is sent to command line will be stored in the variable 'result' and you can do whatever you want with it.

By the way if you want it to show, it should be

<%= `ruby /private/var/www/myapp/script/myscript.rb` %>

The way you have it right now only runs the code, doesn't display the output from doing that.

Cheers, Mohit. 7/12/2007 | 4:54 PM.