title: RoR: Sinatra producing error "uninitialized constant"
body: <p>I'm new to Ruby on Rails (formerly and currently PHP expert) so forgive my ignorance but I'm trying to get Sinatra working as middleware to redirect some old urls since I tried the gem rack-rewrite and couldn't get that to work either.</p>
  
  <p>I am using code samples from <a href="http://asciicasts.com/episodes/222-rack-in-rails-3" rel="nofollow">ASCIIcast</a> so in my routes.rb I have the following:</p>
  
  <pre><code>root :to =&gt; HomeApp
  </code></pre>
  
  <p>(^ I'm redirecting the root only for testing)</p>
  
  <p>In my lib folder I have home_app.rb</p>
  
  <pre><code>class HomeApp &lt; Sinatra::Base  
    get "/" do  
      "Hello from Sinatra"  
    end  
  end 
  </code></pre>
  
  <p>When I start the server (or if its already running) it produces the error:</p>
  
  <pre><code>routes.rb:10: uninitialized constant HomeApp
  </code></pre>
  
  <p>Which seems that it just isn't aware of the lib/home_app.rb file.</p>
  
  <p>I have included Sinatra in my Gemfile and ran bundle install and confirms it is included.</p>
  
  <p>I just want to reroute old urls from my old site to my new ruby app but can't get any of this middleware/rack stuff working. All documentation assumes you aren't a total newb or is for RoR pre-3.0.</p>