title: Best way to run an entire script via ruby -e
body: <p>I've been wanting to run some ruby scripts on remote computers (in a bash shell)</p>
  
  <p>I could create a sequence of bash commands of <code>ruby -e "&lt;command&gt;"</code>, but some of these scripts are over 100 lines.</p>
  
  <p><code>ruby -e</code> with a HEREDOC or <code>%{}</code> &amp; <code>eval()</code> doesn't work well with the mixture of single and double quotes.</p>
  
  <p>Is there a better way to attempt this?</p>
  
  <p>Edit:</p>
  
  <p>The protocol being used is Apple Remote Desktop, which executes these commands in the scope of the remote shell. </p>