ruby - Heroku:未找到且进程已退出

标签 ruby deployment heroku sinatra thin

我不知道如何调试这个。在本地运行这个 ruby​​/sinatra/thin 应用程序我没有任何问题。然而,在 Heroku 上,该应用程序似乎无法加载,显示“未找到”。我不知道如何理解日志:

2013-03-20T22:27:41+00:00 heroku[api]: Enable Logplex by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d5b8acb8b4bcb995b2b8b4bcb9fbb6bab8" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:27:41+00:00 heroku[api]: Release v2 created by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dbb6a2b6bab2b79bbcb6bab2b7f5b8b4b6" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:28:04+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno= queue= wait= connect= service= status=502 bytes=
2013-03-20T22:28:05+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno= queue= wait= connect= service= status=502 bytes=
2013-03-20T22:28:05+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno= queue= wait= connect= service= status=502 bytes=
2013-03-20T22:37:08+00:00 heroku[slugc]: Slug compilation started
2013-03-20T22:37:59+00:00 heroku[api]: Scale to web=1 by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7dacedad6dedbf7d0dad6dedb99d4d8da" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:37:59+00:00 heroku[api]: Add  config by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="89e4f0e4e8e0e5c9eee4e8e0e5a7eae6e4" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:37:59+00:00 heroku[api]: Release v3 created by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0ddc9ddd1d9dcf0d7ddd1d9dc9ed3dfdd" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:38:00+00:00 heroku[api]: Release v4 created by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="96fbeffbf7fffad6f1fbf7fffab8f5f9fb" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:38:00+00:00 heroku[api]: Deploy 0a18d12 by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cfa2b6a2aea6a38fa8a2aea6a3e1aca0a2" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:38:00+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 33969`
2013-03-20T22:38:00+00:00 heroku[slugc]: Slug compilation finished
2013-03-20T22:38:01+00:00 app[web.1]: bash: bundle: command not found
2013-03-20T22:38:02+00:00 heroku[web.1]: Process exited with status 127
2013-03-20T22:38:09+00:00 heroku[web.1]: State changed from starting to up
2013-03-20T22:38:19+00:00 heroku[router]: at=info method=GET path=/ host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=0ms connect=3ms service=79ms status=404 bytes=18
2013-03-20T22:38:21+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=13ms connect=12ms service=69ms status=404 bytes=18
2013-03-20T22:38:21+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=0ms connect=2ms service=21ms status=404 bytes=18
2013-03-20T22:50:19+00:00 heroku[slugc]: Slug compilation started
2013-03-20T22:51:01+00:00 heroku[api]: Release v5 created by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f0216020e06032f08020e0603410c0002" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:51:01+00:00 heroku[api]: Deploy e18aad6 by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7dacedad6dedbf7d0dad6dedb99d4d8da" rel="noreferrer noopener nofollow">[email protected]</a>
2013-03-20T22:51:01+00:00 heroku[web.1]: State changed from up to starting
2013-03-20T22:51:02+00:00 heroku[slugc]: Slug compilation finished
2013-03-20T22:51:09+00:00 heroku[web.1]: State changed from starting to up
2013-03-20T22:52:32+00:00 heroku[router]: at=info method=GET path=/ host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=1ms connect=6ms service=11ms status=404 bytes=18
2013-03-20T22:52:33+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=0ms connect=2ms service=5ms status=404 bytes=18
2013-03-20T22:52:33+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=1ms connect=4ms service=4ms status=404 bytes=18
2013-03-20T22:52:34+00:00 heroku[router]: at=info method=GET path=/ host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=0ms connect=4ms service=4ms status=404 bytes=18
2013-03-20T22:52:35+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=0ms connect=12ms service=4ms status=404 bytes=18
2013-03-20T22:52:35+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=ancient-kings-2615.herokuapp.com fwd="92.225.106.224" dyno=web.1 queue=0 wait=2ms connect=5ms service=4ms status=404 bytes=18 

有什么想法吗?

更新2013年3月21日

我的 gem 文件

source "http://rubygems.org"

# Sinatra
gem "rake"
gem "thin"
gem "sinatra", "~> 1.3.4"
gem "sinatra-contrib", "~> 1.3.1"
gem 'sinatra-assetpack', :require => 'sinatra/assetpack'

# Sass
gem "sass", "~> 3.2.1"

# Mailing related
gem "hominid", "~> 3.0.5"

# Google Analytics: UNCOMMENT IF DESIRED, THEN ADD YOUR OWN ACCOUNT INFO TO config.ru
#gem 'rack-google-analytics', "~> 0.9.2"

我的config.ru

require 'rubygems'
require 'bundler'

Bundler.require

require './app.rb'
run Sinatra::Application

最佳答案

我克隆了该存储库,但无法通过 rackup 使其工作,而这是 Heroku 运行应用程序所依赖的。当直接通过 Ruby 运行 Sinatra 应用程序时,它确实有效。以下是我所做的更改,使其能够与 rackup 一起使用:

config.ru

require 'rubygems'
require 'bundler'

Bundler.require

require File.expand_path 'app.rb', File.dirname(__FILE__)
run App

If you've subclassed, run the subclass, otherwise use Sinatra::Application

我还删除了我发现的所有$:.unshifts,因为它们是邪恶的。

关于ruby - Heroku:未找到且进程已退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15536516/

相关文章:

ruby - Ruby 中 bool 值的大小是多少?

ruby - 比较 Ruby 中的范围

ruby - Nokogiri:如何通过其子标签的内容之一获取 xml 类

ruby - 在路径下删除 Ruby 中的文件夹

ruby - Capistrano:如何在多个项目 deploy.rb 文件中包含通用设置

asp.net - 从 Hudson Build/CI 服务器部署 ASP.NET Web 应用程序

angular - 如何将 Angular 2 应用程序部署为独立应用程序(使用 dist 文件夹)

mysql - Playframework 2.2 和 Heroku : Unable to connect to non-Heroku database

heroku - Heroku 上的 Elixir + Phoenix : Timeout error after 15 seconds

macos - heroku run bash 不工作