# RoR Opening Command Prompt?

**URL:** <https://www.ruby-forum.com/t/ror-opening-command-prompt/189169>\
**Category:** Rails\
**Created:** [May 25, 2010, 10:25pm UTC](https://www.ruby-forum.com/t/ror-opening-command-prompt/189169 "2010-05-25T22:25:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon\_comp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@anon\_comp](https://www.ruby-forum.com/u/anon_comp)\
**Post date:** [May 25, 2010, 10:25pm UTC](https://www.ruby-forum.com/t/ror-opening-command-prompt/189169/1 "2010-05-25T22:25:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon\_comp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@anon\_comp](https://www.ruby-forum.com/u/anon_comp)\
**Post date:** [May 25, 2010, 10:43pm UTC](https://www.ruby-forum.com/t/ror-opening-command-prompt/189169/2 "2010-05-25T22:43:31Z")

</div>

On May 25, 9:24 pm, anon\_comp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![anon\_comp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@anon\_comp](https://www.ruby-forum.com/u/anon_comp)\
**Post date:** [May 25, 2010, 11:06pm UTC](https://www.ruby-forum.com/t/ror-opening-command-prompt/189169/3 "2010-05-25T23:06:21Z")

</div>

On May 25, 4:42 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On May 25, 9:24 pm, anon\_comp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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) As for  
the other two, I have no idea how to use them.

---

<div class="post-metadata">

**Author:** ![anon\_comp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@anon\_comp](https://www.ruby-forum.com/u/anon_comp)\
**Post date:** [May 26, 2010, 4:02am UTC](https://www.ruby-forum.com/t/ror-opening-command-prompt/189169/4 "2010-05-26T04:02:19Z")

</div>

anon\_comp wrote:

> On May 25, 4:42ï¿½pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > On May 25, 9:24ï¿½pm, anon\_comp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![anon\_comp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@anon\_comp](https://www.ruby-forum.com/u/anon_comp)\
**Post date:** [May 26, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/ror-opening-command-prompt/189169/5 "2010-05-26T12:05:24Z")

</div>

You can use system system method in the kernel class of ruby for this  
purpose

look at this link  
[http://ruby-doc.org/core/classes/Kernel.html#M005971](http://ruby-doc.org/core/classes/Kernel.html#M005971)

Hope this helps you.

-Saurav

---

<div class="post-metadata">

**Author:** ![anon\_comp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@anon\_comp](https://www.ruby-forum.com/u/anon_comp)\
**Post date:** [May 26, 2010, 2:31pm UTC](https://www.ruby-forum.com/t/ror-opening-command-prompt/189169/6 "2010-05-26T14:31:10Z")

</div>

Thanks everyone for the information. I got it to work 🙂
