title: Sinatra cannot find views on Ruby 1.9.2-p0
body: <p>I'm quite new to Ruby language (up to now I developed in Groovy + Grails) but since I was curious about it I wanted to try Sinatra on Ruby 1.9.2-p0.</p>
  
  <p>I have a trivial website that is contained in <code>/mywebpage</code> and has 2 files:</p>
  
  <pre><code># blog.rb
  get '/' do
    'Hello World!'
  end
  
  get '/impossible' do
    haml :index
  end
  </code></pre>
  
  <p>and</p>
  
  <pre><code>#config.ru
  path = File.expand_path "../", __FILE__
  
  $LOAD_PATH &lt;&lt; (File.expand_path ".") + "/views"
  
  require 'haml'
  require 'sinatra'
  require "#{path}/blog"
  
  run Sinatra::Application
  </code></pre>
  
  <p>then in the same folder I have a <code>/views/</code> folder that contains <code>index.haml</code>.</p>
  
  <p>I try to run the server with <code>rackup -p8080</code> but when I try to get <code>/impossible</code> I receive the following error:</p>
  
  <pre><code>Errno::ENOENT at /impossible
  No such file or directory - /home/jack/mywebpage/&lt;internal:lib/rubygems/views/index.haml
  </code></pre>
  
  <p>By searching over internet it seems that this maybe caused by "." not being included in <code>$LOAD_PATH</code> so I tried to add it or add directly views <code>./views</code> so that actually <code>$LOAD_PATH.inspect</code> gives me correct path: <code>..., "/home/jack/mywebpage/views"]</code></p>
  
  <p>But still it doesn't seem to work. Being quite new to the framework and the language I was wondering if I'm doing something wrong. any clues?</p>