乘客机架应用程序“无法推断基本路径" [英] Passenger Rack app 'cannot infer basepath'
问题描述
我的 Sinatra 应用有一个简单的 config.ru
文件.
I have a simple config.ru
file for my Sinatra app.
require 'sinatra'
require 'app'
run Sinatra::Application
但是,Passenger 失败并出现错误no such file to load -- app
.我已经尝试使用 1.9 方法 require_relative
但现在导致错误 cannot infer basepath
.
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
.
我目前正在使用非常hacky的require File.join(File.dirname(__FILE__), 'app')
,这太可怕了,我不想每次都这样做想要一个文件.
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.
Ruby 有什么不正常的原因吗?
Is there any reason why Ruby isn't acting as usual?
推荐答案
在 ruby 1.9.2 中,当前目录不再位于 LOAD_PATH 中.
In ruby 1.9.2 the current directory is no more in LOAD_PATH.
那么如果你的 LOAD_PATH 和 add current_directory if 没有被制作怎么办.
So what if your LOAD_PATH and add current_directory if is not made.
这篇关于乘客机架应用程序“无法推断基本路径"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!