2012-06-18 12 views
1

SSup Whiz人!!!我已經在heroku上部署了一個simple_fb_app。當我heroku打開應用程序頁面(https://astute.heroku.com/)它說應用程序錯誤。我檢查了Heroku的日誌,我看到了一個意外的錯誤我檢查了heroku日誌,我看到一個意外的錯誤沒有這樣的文件加載 - ./astute

no such file to load -- ./astute . Please help me solve this i'l buy you beer -:)

我的Gemfile HAS

gem 'sinatra', '1.0' 
gem 'oa-oauth', '0.1.6' 
GEM 

我的Gemfile鎖已經

remote: http://rubygems.org/ 
    specs: 
    addressable (2.2.8) 
    faraday (0.5.7) 
     addressable (~> 2.2.4) 
     multipart-post (~> 1.1.0) 
     rack (>= 1.1.0, < 2) 
    multi_json (0.0.5) 
    multipart-post (1.1.5) 
    nokogiri (1.4.7-x86-mingw32) 
    oa-core (0.1.6) 
     rack (~> 1.1) 
    oa-oauth (0.1.6) 
     multi_json (~> 0.0.2) 
     nokogiri (~> 1.4.2) 
     oa-core (= 0.1.6) 
     oauth (~> 0.4.0) 
     oauth2 (~> 0.1.0) 
    oauth (0.4.6) 
    oauth2 (0.1.1) 
     faraday (~> 0.5.0) 
     multi_json (~> 0.0.4) 
    rack (1.4.1) 
    sinatra (1.0) 
     rack (>= 1.0) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    oa-oauth (= 0.1.6) 
    sinatra (= 1.0) 

THIS IS MY config.ru

  • require'./astute'#this is to負載astute.rb

    運行西納特拉::應用

THIS IS MY astute.rb

require 'sinatra'   #required for framework detection in heroku. 
require 'omniauth/oauth' 

enable :sessions 
disable :show_exceptions 

#Here you have to put your own Application ID and Secret 
APP_ID = "429085837122498" 
APP_SECRET = "2232ac2dd09f452a015f9f00083da8e3" 

use OmniAuth::Builder do 
    provider :facebook, APP_ID, APP_SECRET, { :scope => 'email, status_update, publish_stream' } 
end 

get '/' do 
    @articles = [] 
    @articles << {:title => 'Deploying Rack-based apps in Heroku', :url => 'http://docs.heroku.com/rack'} 
    @articles << {:title => 'Learn Ruby in twenty minutes', :url => 'http://www.ruby-lang.org/en/documentation/quickstart/'} 

    erb :index 
end 

get '/auth/facebook/callback' do 
    session['fb_auth'] = request.env['omniauth.auth'] 
    session['fb_token'] = session['fb_auth']['credentials']['token'] 
    session['fb_error'] = nil 
    redirect '/' 
end 

get '/auth/failure' do 
    clear_session 
    session['fb_error'] = 'In order to use this site you must allow us access to your Facebook data<br />' 
    redirect '/' 
end 

get '/logout' do 
    clear_session 
    redirect '/' 
end 

def clear_session 
    session['fb_auth'] = nil 
    session['fb_token'] = nil 
    session['fb_error'] = nil 
end 
+0

什麼的'在你的應用文件中需要'語句說?你的app目錄中是否有'astute.rb'文件? – Kashyap

+0

是的,我的應用程序目錄中有一個astute.rb文件 您可以在這裏將它克隆出來 git clone [email protected]:astute.git -o heroku –

回答

0

你config.ru應該是:

require './astute' 

    run Sinatra::Application 
+0

Iam害怕我的config.ru完全像這樣,但它似乎沒有工作。 另外,當我在本地主機上打開它時,它給我帶來了這個錯誤 錯誤NoMethodError:未定義的方法'include?' for nil:N –

+0

這裏沒有人可以解決這個問題嗎? –

相關問題