Forum: Ruby How to run a terminal command from a Ruby app?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73e6ae598b7a61be53afdc77af8df37d?d=identicon&s=25 Victor Martin (eltercero)
on 2009-05-21 11:27
Hi there.

I'm using Ruby and the great Processing implementation made for Ruby
(http://github.com/jashkenas/ruby-processing/wikis). The "problem" is
that if you need to run anything of Ruby-Processing, you need to write:

#rp5 run app.rb

Instead of #ruby app.rb

So, what I need is executing the "rp5 run" command from another ruby
application, since I'm generating the Processing document in another
Ruby app which does not use Ruby-Processing.

I'm running Ruby from Mac Os X. Any idea?
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2009-05-21 11:49
system("rp5 run foo")
9dec3df8319c613f6f4f14a27da0fdb4?d=identicon&s=25 Kyle Schmitt (Guest)
on 2009-05-21 15:47
(Received via mailing list)
On Thu, May 21, 2009 at 4:49 AM, Brian Candler <b.candler@pobox.com>
wrote:
> system("rp5 run foo")
or, if you need the output what you ran,
foo=%x{rp5 run foo}
# note, you can use most paired symbols, like () [] <>, or quotes "" '',
#with %x, not just {}

--Kyle
73e6ae598b7a61be53afdc77af8df37d?d=identicon&s=25 Victor Martin (eltercero)
on 2009-05-22 17:36
thanks! it worked perfect with "system("rp5 run foo")
This topic is locked and can not be replied to.