【问题标题】:Heroku: Not Found & Process ExitedHeroku:未找到并退出进程
【发布时间】:2013-03-10 07:30:39
【问题描述】:

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

2013-03-20T22:27:41+00:00 heroku[api]: Enable Logplex by mymail@gmail.com
2013-03-20T22:27:41+00:00 heroku[api]: Release v2 created by mymail@gmail.com
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 mymail@gmail.com
2013-03-20T22:37:59+00:00 heroku[api]: Add  config by mymail@gmail.com
2013-03-20T22:37:59+00:00 heroku[api]: Release v3 created by mymail@gmail.com
2013-03-20T22:38:00+00:00 heroku[api]: Release v4 created by mymail@gmail.com
2013-03-20T22:38:00+00:00 heroku[api]: Deploy 0a18d12 by mymail@gmail.com
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 mymail@gmail.com
2013-03-20T22:51:01+00:00 heroku[api]: Deploy e18aad6 by mymail@gmail.com
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 

有什么想法吗?

21.3.2013 更新

我的宝石文件

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

【问题讨论】:

  • 这一行似乎是问题的开始:“2013-03-20T22:38:01+00:00 app[web.1]: bash: bundle: command not found”。您能否发布您的 Gemfile 以及您如何在应用程序中调用 Bundler 来设置要求?哦,还有一些版本的东西——Sinatra、Ruby、Bundler。
  • 嘿@iain,rails 3.2.12,bundler 1.1.5。我在这里开始使用这个项目:github.com/jasonmelgoza/armor
  • app.rb 顶部的这一行是干什么用的? $:.unshift File.expand_path('../../../lib', __FILE__) 我没有看到 lib 目录!
  • 呃,我不确定它到底是做什么的我检查了我的文件结构,现在有一个 v 文件夹,在 @iain 之前肯定不存在。它包含像 admin/app/config/lib/log/public/script/test 这样的文件夹。我还下载了一个新的盔甲安装并部署到 Heroku,基本上给了我同样的“未找到”错误。
  • @iain 忘了那个 v 目录,我不知道它是如何到达那里的,但它肯定没有任何业务。

标签: ruby deployment heroku sinatra thin


【解决方案1】:

我克隆了 repo,但无法通过 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,因为它们是邪恶的。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2020-09-25
  • 2019-02-26
  • 2020-07-03
  • 1970-01-01
  • 2022-10-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多