SSup Whiz人!!!我在heroku上部署了一个simple_fb_app。当我打开应用程序页面(https://astute.heroku.com/)时,它会显示应用程序错误。我检查了heroku日志,我看到了一个意外错误
没有要加载的文件 - ./astute。请帮我解决这个问题 你喝啤酒 - :)
我的GEMFILE已经
gem 'sinatra', '1.0'
gem 'oa-oauth', '0.1.6'
GEM
我的GEMFILE LOCK已经
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)
这是我的config.ru
要求'./astute'#这是加载astute.rb
运行Sinatra :: Application
这是我的精明.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 :(得分:0)
你的config.ru应该是:
require './astute'
run Sinatra::Application