2011-11-17 150 views
2

所以,我真的非常努力。我要打我的朋友,如果我不能解決這個問題... 所以,我試圖部署一個Sinatra應用程序到Heroku,但每次我嘗試,我得到相同的錯誤信息,好老「應用程序錯誤」。 它運行順利在我的本地服務器,順便說一下,通過運行Heroku + Sinatra:H10(應用程序崩潰)

$ruby sppin.rb 

這是我的日誌,我的config.ru文件: (抱歉lenght = /)

2011-11-17T18:14:47+00:00 heroku[api]: Deploy 438c175 by [email protected] 
2011-11-17T18:14:47+00:00 heroku[api]: Release v13 created by [email protected] 
2011-11-17T18:14:47+00:00 heroku[web.1]: State changed from created to starting 
2011-11-17T18:14:47+00:00 heroku[slugc]: Slug compilation finished 
2011-11-17T18:14:50+00:00 heroku[web.1]: Starting process with command `thin -p 19178 -e production -R /home/heroku_rack/heroku.ru start` 
2011-11-17T18:14:50+00:00 app[web.1]: <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- sppin (LoadError) 
2011-11-17T18:14:50+00:00 app[web.1]: from <internal:lib/rubygems/custom_require>:29:in `require' 
2011-11-17T18:14:50+00:00 app[web.1]: from config.ru:1:in `block (3 levels) in <main>' 
2 011-11-17T18:14:50+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `eval' 
2011-11-17T18:14:50+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `block (3 levels) in <main>' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:63:in `new' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:63:in `map' 
2011-11-17T18:14:50+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:18:in `block (2 levels) in <main>' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' 
2011-11-17T18:14:50+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:11:in 

2011-11-17T18:14:50+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:11:in `block in <main>' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' 
2011-11-17T18:14:50+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1:in `new' 
2011-11-17T18:14:50+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1:in `<main>' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `eval' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `load' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:175:in `load_rackup_config' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:65:in `start' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:177:in `run_command' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:143:in `run!' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/bin/thin:6:in `<top (required)>' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/bin/thin:19:in `load' 
2011-11-17T18:14:50+00:00 app[web.1]: from /usr/ruby1.9.2/bin/thin:19:in `<main>' 
2011-11-17T18:14:50+00:00 heroku[web.1]: Process exited 
2011-11-17T18:14:51+00:00 heroku[web.1]: State changed from starting to crashed 
2011-11-17T18:14:52+00:00 heroku[router]: Error H10 (App crashed) -> GET freezing-sky-8753.heroku.com/ dyno= queue= wait= service= status=503 bytes= 
2011-11-17T18:14:52+00:00 heroku[nginx]: 150.164.3.247 - - [17/Nov/2011:10:14:52 -0800] "GET/HTTP/1.1" 503 607 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" freezing-sky-8753.heroku.com 
2011-11-17T18:14:53+00:00 heroku[router]: Error H10 (App crashed) -> GET freezing-sky-8753.heroku.com/favicon.ico dyno= queue= wait= service= status=503 bytes= 
2011-11-17T18:14:53+00:00 heroku[nginx]: 150.164.3.247 - - [17/Nov/2011:10:14:53 -0800] "GET /favicon.ico HTTP/1.1" 503 607 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" freezing-sky-8753.heroku.com 

config.ru:

require 'sppin' 
    run Sinatra::Application 

而且,僅僅是爲了記錄,我sppin.rb文件:(非常基本的東西)

require 'rubygems' 
require 'sinatra' 
require 'haml' 

get '/' do 
    @title = "Sppin" 
    haml :index 
end 

回答

2

剛剛發現我的問題。我必須將.gems文件添加到我的應用程序根目錄,包括我在應用程序中使用的任何gem。在我的情況下,我只是使用Sinatra和Haml,所以,我的.gems文件是:

source 'http://rubygems.org' 
'sinatra' 
'haml' 
0

使用絕對路徑(根據您的情況進行調整)。

require File.expand_path('../sppin', __FILE__) 
+0

不是。不會做... –