config.ru我的Sinatra应用程序有一个简单的文件.
require 'sinatra'
require 'app'
run Sinatra::Application
Run Code Online (Sandbox Code Playgroud)
但是,Passenger因错误而失败no such file to load -- app.我尝试过使用1.9方法require_relative但现在导致错误cannot infer basepath.
我目前正在使用非常hacky require File.join(File.dirname(__FILE__), 'app' ),这是非常可怕的,我不想每次我想要一个文件时这样做.
有没有理由为什么Ruby不像往常一样?
我有一个非常简单的jQuery来检索我最新的推文
$.getJSON("http://twitter.com/statuses/user_timeline/username.json?count=1",
function(data) {
$("#tweet_text").html(data[0].text);
});
Run Code Online (Sandbox Code Playgroud)
这适用于我桌面上的简单HTML文件.但是,一旦从我的localhost(apache)访问该文件,就不会返回任何数据.我想知道Apache的任何部分是否以某种方式阻止了这个请求?还是其他任何想法?