title: Run a Windows Batch File Through Wine Using Ruby on Rails in Linux
body: <p>I'm developing a web application using Ruby on Rails and running it on a Linux (ubuntu) server. My backend processing is based on a Windows .bat file that calls a network of other .bat files based on a list of about 5 parameters.</p>
  
  <p>So basically, I'm trying to call the initial batch file with command line preferences through wine in my Rails application. </p>
  
  <p>For example, this is similar to what I use to successfully run the code in the ubuntu terminal:</p>
  
  <pre><code>wine cmd.exe /C InitialCallFile.bat Directory/Input.xml Directory/Output.xml param1 param2
  </code></pre>
  
  <p>I tried to call it with the System and %x commands in Ruby. For example:</p>
  
  <pre><code>System "wine cmd.exe /C InitialCallFile.bat self.infile self.outfile self.param1 self.param2"
  system wine cmd.exe InitialCallFile.bat [self.infile, self.outfile, self.param1, self.param2]
  %x[wine cmd.exe /C InitialCallFile.bat self.infile self.outfile self.param1 self.param2]
  </code></pre>
  
  <p>and other similar variations</p>
  
  <p>However, the program doesn't recognize cmd and comes back with the error:
  undefined local variable or method `cmd'</p>
  
  <p>How should I go about correctly calling an application in wine using Ruby on Rails?</p>