title: How can I execute a Ruby script as executable file?
body: <p>i want to execute my ruby script as executable file and also i should execute at /usr/bin/ directory. I know it is possible like this.</p>
  
  <pre><code>#!/usr/bin/ruby
  puts "hello"
  </code></pre>
  
  <p>And </p>
  
  <pre><code>chmod +x hello
  </code></pre>
  
  <p>But I also want to require some ruby file.</p>
  
  <p>For example if I add </p>
  
  <pre><code>require './other_ruby_script' 
  </code></pre>
  
  <p>into my codes and I move the Ruby executable file to /usr/bin/, it gives me error for:</p>
  
  <p>cannot load such file 'other_ruby_script'</p>
  
  <p>I want to execute the Ruby file at /usr/bin directory.</p>
  
  <p>So maybe I should compile it? But I couldn't compile because i didn't understand when google searches "How to compile?". </p>
  
  <p>How can i create executable ruby code as suitable format for my codes. (require './other_file'). And i don't have to execute like this ./hello my executable file. Just i should execute as hello</p>