title: Sinatra Modular Application not working
body: <p>I am new to Sinatra, and am learning it by following the README file. My ultimate goal is to create a modular application as described on the <a href="http://www.sinatrarb.com/intro#Serving%20a%20Modular%20Application" rel="nofollow">Sinatra Serving Modular Application</a> page. Unfortunately, my application doesn't work - if I use <code>config.ru</code> it generates an error: </p>
  
  <blockquote>
  <pre><code>uninitialized constant Object::MyClass (NameError)  
  </code></pre>
  </blockquote>
  
  <p>and modifying the code to do:</p>
  
  <pre><code>run! if app_file == $0  
  </code></pre>
  
  <p>is not working as well. Below is my code:</p>
  
  <p>my_app.rb: </p>
  
  <pre><code>require 'sinatra/base'
  class MyApp &lt; Sinatra::Base
      get '/' do  
              test  
      end  
      def test  
              return "Hello World!"  
      end  
  end
  </code></pre>
  
  <p>config.ru:</p>
  
  <pre><code>require File.dirname(__FILE__)+'/my_app'  
  run Myapp.new
  </code></pre>
  
  <p>The commands <code>ruby config.ru</code> and <code>rackup -p 4567</code> are not working - I receive (<code>NameError</code>), as I mentioned before. Does anyone have any ideas? Thank you so much.</p>