Ruby and Ghostscript

Hi guy
I know :
To use Ghostscript to combine PDF files, type something like the
following:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf
file1.pdf file2.pdf

where we run this command in Ruby on Rails? or where we run it ?
Please help me.Thanks