There is no such file for loading a passenger and a sinatra

I recently upgraded to Ruby 1.9.2 (RVM), Sinatra 1.1, and Passenger 3.0.0. I have a simple application consisting of:

# config.ru require 'rubygems' require 'sinatra' require 'app.rb' run Sinatra::Application # app.rb require 'rubygems' require 'sinatra' get '/' do erb :index end 

If I run the application from the terminal using ruby app.rb , everything starts as expected. However, with Passenger I get: no such file to load -- app.rb I have other Rails applications that work fine with customization, and have configured the document root to a secondary shared directory. Any ideas how to fix this? Thanks!

+7
passenger sinatra
source share
2 answers

I had the same problem:

 # config.ru require 'rubygems' require 'sinatra' require File.dirname(__FILE__) + "/app.rb" run Sinatra::Application 
+17
source share

I managed to solve the problem. For some reason, the expression config.ru requires that include is relative to the current directory. Modified file:

 # config.ru require 'rubygems' require 'sinatra' require './app.rb' run Sinatra::Application 
+9
source share

All Articles