“No such file to load” error using Sinatra?

Having issues with your config.ru, getting the “no such file to load” error for your app.rb/hello.rb?

Over at stackoverflow, we see the general answer.

By default, a script should not know what the current directory is. Think namespaces.

To fix it, just add ‘./’ to the .rb file you’re trying to include in your config.ru. Easy.

require ‘app.rb’

becomes

require ‘./app.rb’

Heroku problem? Make sure you’re running the right version of Ruby. This issue will come up with Ruby 1.9 and later.