使我的基于sinatra的应用程序在Heroku上工作的问题 [英] Problems getting my sinatra based app to work on Heroku

查看:118
本文介绍了使我的基于sinatra的应用程序在Heroku上工作的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个简单的Sinatra应用程序来运行主页。它已经在我的电脑上工作了。现在我想在heroku上托管它,但我无法管理它使其运行。我对Gemfile或Procfile等概念并不熟悉。



我的ruby应用程序需要Sinatra,haml和sinatra / r18n。我的gemfile如下所示:

 来源:rubygems 
gem'sinatra'
gem'thin'
gem'sinatra-r18n'
gem'haml'

我的Procfile看起来像这:

  web:bundle exec ruby​​ app.rb -p $ PORT 

我的app.rb是这样开始的:

 # app.rb 

要求'rubygems'
要求'sinatra'
要求'sinatra / r18n'
要求'haml'

启用:会话

助手做
def set_lang(langcode)
...

目录中的其他文件包括Gemfile.lock,如果我没有记错,它是通过软件包安装创建的,并且文件夹是r18n,public,views。

如果我在heroku上启动应用程序,heroku ps命令表示应用程序启动,但是如果我使用heroku open,则会出现内部服务器错误。



这里是heroku l ogs之后,我把它推到heroku:

  2012-09-15T19:34:54+ 00:00 heroku [slugc]:Slug编辑开始
2012-09-15T19:35:01 + 00:00 heroku [api]:发布v13由-@gmail.com创建
2012-09- 15T19:35:01 + 00:00 heroku [api]:部署bebc79e by -@gmail.com
2012-09-15T19:35:01 + 00:00 heroku [web.1]:状态从up to start
2012-09-15T19:35:01 + 00:00 heroku [slugc]:S comp编辑完成
2012-09-15T19:35:02 + 00:00 heroku [web.1] :使用命令`bundle exec ruby​​ app.rb -p 54979`启动进程
2012-09-15T19:35:05 + 00:00 heroku [web.1]:使用SIGTERM
2012停止所有进程-09-15T19:35:05 + 00:00 heroku [web.1]:状态从开始改为
2012-09-15T19:35:06 + 00:00 app [web.1]:= = Sinatra / 1.1.0已经在20773上采用了从Thin
2012-09-15T19:35:06 + 00:00 app [web.1]:>备份的备份制作。精简网页伺服器(v1.4.1 codename Chromeo)
2012-09-15T19:35:06 + 00:00 app [web.1]:>>最大连接数设置为1024
2012-09-15T19:35:06 + 00:00 app [web.1]:>>听取0.0.0.0:20773,CTRL + C停止
2012-09-15T19:35:06 + 00:00 app [web.1]:>>正在停止...
2012-09-15T19:35:06 + 00:00 app [web.1]:
2012-09-15T19:35:06 + 00:00 app [web.1 ]:== Sinatra已经结束他的设置(众人鼓掌)
2012-09-15T19:35:07 + 00:00 heroku [web.1]:进程退出状态为0

有没有人知道这里有什么问题?如果你对所使用的概念更熟悉,也许有些事情很明显。我也会提供帮助我解决问题的材料的提示,但直到现在,我所有的Google搜索/阅读都无济于事。

更新28-09
我现在从代码中移除了Procfile,仍然收到内部服务器错误。这里有更多的日志应该包括崩溃:

  2012-09-28T18:04:50 + 00:00 heroku [ web.1]:状态从下拉改为开始
2012-09-28T18:04:58 + 00:00 heroku [web.1]:用命令`bundle exec thin start start -R config.ru启动进程 - e生产-p 30813`
2012-09-28T18:05:01 + 00:00 heroku [web.1]:状态从开始变为
2012-09-28T18:05:02+ 00:00 app [web.1]:/app/views/start.haml:1:in`evaluate_source'
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundle / ruby​​ / 1.9.1 / gems / tilt-1.3.3 / lib / tilt / template.rb:209:`instance_eval'
2012-09-28T18:05:02 + 00: 00 app [web.1]:Encoding :: CompatibilityError - 不兼容的字符编码:ASCII-8BIT和UTF-8:
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundle / ruby​​ / 1.9.1 / gems / tilt-1.3.3 / lib / tilt / template.rb:209:在`evaluate_source'
2012-09-28T18:05:02 + 00: 00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:127:in`eva luate'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt /template.rb:144:in`cached_evaluate'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/ tilt-1.3.3 / lib / tilt / haml.rb:24:在`evaluate'
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundle /ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:76:in`render'
2012-09-28T18:05:02 + 00:00 app [web。 1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:452:in`render'
2012-09-28T18:05: 02 + 00:00 app [web.1]:/app/app.rb:28:in`block in< top(required)>'
2012-09-28T18:05:02 + 00: 00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:370:in`haml'
2012-09 -28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1032:in`请拨打'
2012-09-28T18:05:02 + 00:00应用[web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatr a / base.rb:1032:在`block in compile!'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9。 1 / gems / sinatra-1.1.0 / lib / sinatra / base.rb:620:在`instance_eval'
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app /vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:620:in`route_eval'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:656:in`block in process_route'
2012- 09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:653:in `catch'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/ '
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundles / base.rb:604:在路由中的块(2级) ruby / 1.9.1 / gems / sinatra-1.1.0 / lib / sinatra / base.rb:653:在`process_route'
2012-09-28T18:05:02 + 00:00 app [web.1 ]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:6 03:在路由块中'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra- 1.1.0 / lib / sinatra / base.rb:602:在`each'
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundle / ruby /1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:602:in`route!'
2012-09-28T18:05:02 + 00:00 app [web.1 ]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in`block in call!'
2012-09-28T18: 05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in`instance_eval'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base。 rb:741:in'dispatch!'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra- 1.1.0 / lib / sinatra / base.rb:706:在`block in invoke'中
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundle /ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in`catch'
2012-09-28T18:05:02+ 00:00 heroku [router]:GET fierce-crag-6255.herokuapp.com/ dyno = web.1 queue = 0 wait = 0ms service = 73ms status = 500 bytes = 30
2012-09-28T18:05 :02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in`invoke'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb :516:在`call'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1。 0 / lib / sinatra / base.rb:530:在`call!'
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundle / ruby​​ / 1.9.1 / gems / sinatra-1.1.0 / lib / sinatra / base.rb:1168:在`synchronize'
2012-09-28T18:05:02 + 00:00 app [web.1]: /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in`call'
2012-09-28T18:05 :02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in`call'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gem s / rack-1.4.1 / lib / rack / commonlogger.rb:20:在`call'
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor /bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in`context'
2012-09-28T18:05:02 + 00 :00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in`block in call'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:80 :在`block in pre_process'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/thin-1.4。 1 / lib / thin / connection.rb:53:在`process'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9 .1 / gems / thin-1.4.1 / lib / thin / connection.rb:78:在`pre_process'中
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor / bundle / ruby​​ / 1.9.1 / gems / thin-1.4.1 / lib / thin / connection.rb:38:在`receive_data'
2012-09-28T18:05:02 + 00: 00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:7 8:在'catch'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10 /lib/eventmachine.rb:256:in`run'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/ gems / sinatra-1.1.0 / lib / sinatra / base.rb:1142:在`call'
2012-09-28T18:05:02 + 00:00 app [web.1]:/ app / vendor /bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/backends/base.rb:63:in`start'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in`run_machine'
2012-09-28T18: 05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/server.rb:159:in`start'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/ controller.rb:86:在'start'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/thin -1.4.1 / lib / thin / runner.rb:185:在`run_command'
2012-09-28T18:05:02 + 00:00 app [web .1]:/app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in`run!'
2012-09-28T18: 05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in`< top(required)> ;'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/bin/thin:19:in`load'
2012-09-28T18:05:02 + 00:00 app [web.1]:/app/vendor/bundle/ruby/1.9.1/bin/thin:19:in`< main>'
2012-09-28T18:05:02 + 00:00 app [web.1]:212.90.85.15 - - [28 / Sep / 2012 18:05:02]GET / HTTP / 1.1500 30 0.0591
2012-09-28T18:05:03 + 00:00 app [web.1]:212.90.85.15 - - [28 / Sep / 2012 18:05:03]GET /favicon.ico HTTP / 1.1 200 1416 0.0109
2012-09-28T18:05:03 + 00:00 heroku [路由器]:GET fierce-crag-6255.herokuapp.com/favicon.ico dyno = web.1 queue = 0 wait = 0ms service = 13ms status = 200 bytes = 1416
2012-09-28T18:05:03 + 00:00 heroku [路由器]:GET fierce-crag-6255.herokuapp.com/favicon.ico dyno = web。 1队列= 0等待= 0ms服务= 4ms状态= 200字节= 1416
2012-09-28T 18:05:03 + 00:00 app [web.1]:212.90.85.15 - - [28 / Sep / 2012 18:05:03]GET /favicon.ico HTTP / 1.1200 1416 0.0026


解决方案

耶,我只是自己弄明白了。我应该更加注意heroku日志中的 Encoding :: CompatibilityError - 不兼容的字符编码:ASCII-8BIT和UTF-8:。我删除了所有的德语变音,现在它正在工作。现在使用编码的问题已经在这里了。我希望我能以某种方式解决这个问题。谢谢大家!


I made a simple Sinatra app to run a homepage. It's already working on my computer. Now I wanted to host it at heroku, but I can't manage it to make it run. I am not really familiar with concepts like "Gemfile" or "Procfile".

My ruby app requires Sinatra, haml and sinatra/r18n. My gemfile looks like this:

source :rubygems
gem 'sinatra'
gem 'thin'
gem 'sinatra-r18n'
gem 'haml'

My Procfile looks like this:

web: bundle exec ruby app.rb -p $PORT

My app.rb starts like this:

# app.rb

require 'rubygems'
require 'sinatra'
require 'sinatra/r18n'
require 'haml'

enable :sessions

helpers do
  def set_lang (langcode)
...

Other files in the directory include the Gemfile.lock which was created through bundle install if I remember correctly and folders for "r18n", "public", "views".

If I start the application on heroku the "heroku ps" command says the application is "up" but if I use "heroku open" I get an "Internal Server Error".

Here is the "heroku logs" after I push it to heroku:

2012-09-15T19:34:54+00:00 heroku[slugc]: Slug compilation started
2012-09-15T19:35:01+00:00 heroku[api]: Release v13 created by -@gmail.com
2012-09-15T19:35:01+00:00 heroku[api]: Deploy bebc79e by -@gmail.com
2012-09-15T19:35:01+00:00 heroku[web.1]: State changed from up to starting
2012-09-15T19:35:01+00:00 heroku[slugc]: Slug compilation finished
2012-09-15T19:35:02+00:00 heroku[web.1]: Starting process with command `bundle exec ruby app.rb -p 54979`
2012-09-15T19:35:05+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-09-15T19:35:05+00:00 heroku[web.1]: State changed from starting to up
2012-09-15T19:35:06+00:00 app[web.1]: == Sinatra/1.1.0 has taken the stage on 20773 for production with backup from Thin
2012-09-15T19:35:06+00:00 app[web.1]: >> Thin web server (v1.4.1 codename Chromeo)
2012-09-15T19:35:06+00:00 app[web.1]: >> Maximum connections set to 1024
2012-09-15T19:35:06+00:00 app[web.1]: >> Listening on 0.0.0.0:20773, CTRL+C to stop
2012-09-15T19:35:06+00:00 app[web.1]: >> Stopping ...
2012-09-15T19:35:06+00:00 app[web.1]:
2012-09-15T19:35:06+00:00 app[web.1]: == Sinatra has ended his set (crowd applauds)
2012-09-15T19:35:07+00:00 heroku[web.1]: Process exited with status 0

Has anybody an idea what's going wrong here? Maybe something obvious if you are more familiar to the used concepts. I also would take hints for material that helps me to solve the problem, but until now all my googling/reading didn't help.

Update 28-09 I now removed the Procfile from code and still get the "Internal Server Error". Here is some more log which should include the crash:

 2012-09-28T18:04:50+00:00 heroku[web.1]: State changed from down to starting
 2012-09-28T18:04:58+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 30813`
 2012-09-28T18:05:01+00:00 heroku[web.1]: State changed from starting to up
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/views/start.haml:1:in `evaluate_source'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `instance_eval'
 2012-09-28T18:05:02+00:00 app[web.1]: Encoding::CompatibilityError - incompatible character encodings: ASCII-8BIT and UTF-8:
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:209:in `evaluate_source'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/haml.rb:24:in `evaluate'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:452:in `render'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/app.rb:28:in `block in <top (required)>'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:370:in `haml'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1032:in `call'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1032:in `block in compile!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:620:in `instance_eval'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:620:in `route_eval'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:656:in `block in process_route'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:653:in `catch'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:604:in `block (2 levels) in route!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:653:in `process_route'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:603:in `block in route!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:602:in `each'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:602:in `route!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `block in call!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `instance_eval'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:741:in `dispatch!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `block in invoke'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `catch'
 2012-09-28T18:05:02+00:00 heroku[router]: GET fierce-crag-6255.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=73ms status=500 bytes=30
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `invoke'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:516:in `call'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `call!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1168:in `synchronize'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/commonlogger.rb:20:in `call'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `block in call'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:80:in `block in pre_process'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:53:in `process'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:78:in `pre_process'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:38:in `receive_data'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:78:in `catch'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `call'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/backends/base.rb:63:in `start'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/server.rb:159:in `start'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:86:in `start'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `load'
 2012-09-28T18:05:02+00:00 app[web.1]:  /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>'
 2012-09-28T18:05:02+00:00 app[web.1]: 212.90.85.15 - - [28/Sep/2012 18:05:02] "GET / HTTP/1.1" 500 30 0.0591
 2012-09-28T18:05:03+00:00 app[web.1]: 212.90.85.15 - - [28/Sep/2012 18:05:03] "GET /favicon.ico HTTP/1.1" 200 1416 0.0109
 2012-09-28T18:05:03+00:00 heroku[router]: GET fierce-crag-6255.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=13ms status=200 bytes=1416
 2012-09-28T18:05:03+00:00 heroku[router]: GET fierce-crag-6255.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms status=200 bytes=1416
 2012-09-28T18:05:03+00:00 app[web.1]: 212.90.85.15 - - [28/Sep/2012 18:05:03] "GET /favicon.ico HTTP/1.1" 200 1416 0.0026

解决方案

Yay, I just figured it out myself. I should have put more attention to the Encoding::CompatibilityError - incompatible character encodings: ASCII-8BIT and UTF-8: in the heroku logs. I removed all the German umlauts and now it is working. The problem now with the encoding is adressed here. I hope I can figure this out somehow. Thanks everyone anyway!

这篇关于使我的基于sinatra的应用程序在Heroku上工作的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆