所以,我真的很喜欢这个。如果我不能解决这个问题,我打算打我的朋友...... 所以,我正在尝试将一个Sinatra应用程序部署到Heroku,但每次我尝试时,都会收到相同的错误消息,即旧的“应用程序错误”。 顺便说一句,它在我的本地服务器上运行顺利运行
$ruby sppin.rb
这是我的日志和我的config.ru文件: (对不起,lenght。= /)
2011-11-17T18:14:47+00:00 heroku[api]: Deploy 438c175 by arthur@sppin.com.br
2011-11-17T18:14:47+00:00 heroku[api]: Release v13 created by arthur@sppin.com.br
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
答案 0 :(得分:2)
刚刚发现我的问题。我不得不将.gems文件添加到我的应用程序根目录,包括我在我的应用程序中使用的任何gem。就我而言,我只使用了Sinatra和Haml,所以,我的.gems文件是:
source 'http://rubygems.org'
'sinatra'
'haml'
答案 1 :(得分:0)
使用绝对路径(根据您的情况进行调整)。
require File.expand_path('../sppin', __FILE__)