title: Running .rb file using Jenkins
body: <p>I have ruby file <code>sample.rb</code></p>
  
  <p>content of file are</p>
  
  <pre><code>puts "Hello Ruby"
  </code></pre>
  
  <p>When I am executing this on Windows cmd it works fine but when I am trying it to execute through Jenkins it won't work.How can I run this file using Jenkins?</p>
  
  <p>version of ruby I am using</p>
  
  <pre><code>ruby -v
  ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Tried to run ruby -v in jenkins it gives me following error</p>
  
  <pre><code>[HelloRuby] $ cmd /c call C:\WINDOWS\TEMP\jenkins8144880231444275150.bat
  
  D:\Jenkins\workspace\HelloRuby&gt;ruby -v 
  'ruby' is not recognized as an internal or external command,
  operable program or batch file.
  
  D:\Jenkins\workspace\HelloRuby&gt;exit 9009 
  Build step 'Execute Windows batch command' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <p>Config for ruby in jenkins
  <a href="https://i.stack.imgur.com/rR3m0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rR3m0.png" alt="enter image description here"></a></p>