Passenger Rack app 'cannot infer basepath'

吃可爱长大的小学妹 提交于 2019-12-07 01:07:26

问题


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:


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.



来源:https://stackoverflow.com/questions/3811781/passenger-rack-app-cannot-infer-basepath

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!