views:

43

answers:

1

I have a simple config.ru file for my Sinatra app.

require 'sinatra'
require 'app'

run Sinatra::Application

However, Passenger is failing with the error no such file to load -- app. I've tried using the 1.9 method require_relative but that now causes the error cannot infer basepath.

I'm currently using the very hacky require File.join(File.dirname(__FILE__), 'app' ), which is just horrible and I don't fancy doing that every time I want to require a file.

Is there any reason why Ruby isn't acting as usual?

+1  A: 

In ruby 1.9.2 the current directory is no more in LOAD_PATH.

So what if your LOAD_PATH and add current_directory if is not made.

shingara
I didn't know that. Interesting. However, I still don't understand why `require_relative` wouldn't work.
fatnic
Or I can just `require "./app"` which seems easier.
fatnic
Yes, it's same thing about the current_directory no in LOAD_PATH
shingara