Is there a code for Ruby on Rails to open Command Prompt, input a line, and execute it? If not, is there something similar or an alternative I can use?
Thanks, anon_comp
Is there a code for Ruby on Rails to open Command Prompt, input a line, and execute it? If not, is there something similar or an alternative I can use?
Thanks, anon_comp
Is there a code for Ruby on Rails to open Command Prompt, input a line, and execute it? If not, is there something similar or an alternative I can use?
system, `` or IO.popen ?
Fred
I've tried IO.popen and couldn't seem to get it to take in additional parameters (sorry, seemed to have forgotten that information) As for the other two, I have no idea how to use them.
anon_comp wrote:
> Is there a code for Ruby on Rails to open Command Prompt, input a > line, and execute it? If not, is there something similar or an > alternative I can use?
system, `` or IO.popen ?
Fred
I've tried IO.popen and couldn't seem to get it to take in additional parameters (sorry, seemed to have forgotten that information)
Check its documentation.
As for the other two, I have no idea how to use them.
So read the docs and/or the Pickaxe Book! What's the problem?
Best,
You can use system system method in the kernel class of ruby for this purpose
look at this link
Hope this helps you.
-Saurav
Thanks everyone for the information. I got it to work