【发布时间】:2011-12-18 17:31:06
【问题描述】:
我已经使用 Ruby on Rails 创建了简单的应用程序,并尝试在 Heroku 上提交它。我关注了这个Getting Started on Heroku guide, 我完成它并尝试打开我的页面,但我仍然看到一个错误: 应用程序错误:
应用程序发生错误,您的页面无法访问 服务。请稍后再试。
如果您是应用程序所有者,请查看您的日志以了解详细信息。
有人知道怎么处理吗?
我不知道发生了什么,但我已经完成了这一步,不幸的是我遇到了另一个问题,我运行了一些命令:
# git add .
# git commit -m "我的提交"
在分支 master 上无需提交(工作目录干净)
# git push heroku 掌握一切都是最新的
# heroku 打开 打开 http://eerie-meadow-9207.heroku.com/
# heroku 重启 重新启动进程...完成
# heroku 打开 打开 http://eerie-meadow-9207.heroku.com/
我看到一条消息:
很抱歉,出了点问题。
我们已收到有关此问题的通知,我们会尽快查看。
来自heroku logs[为清楚起见删除了时间戳]:
app[web.1]: Started GET "/" for 77.236.11.34 at 2011-10-31 11:50:38 -0700
app[web.1]: Processing by StoreController#index as HTML
app[web.1]: Completed 500 Internal Server Error in 3ms
heroku[router]: GET eerie-meadow-9207.heroku.com/ dyno=web.1 queue=0 wait=0ms service=13ms status=500 bytes=728
heroku[nginx]: 77.236.11.34 - - [31/Oct/2011:11:50:38 -0700] "GET / HTTP/1.1" 500 728 "-" "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23" eerie-meadow-9207.heroku.com
app[web.1]:
heroku[web.1]: State changed from up to bouncing
heroku[web.1]: State changed from bouncing to created
heroku[web.1]: State changed from created to starting
heroku[web.1]: Starting process with command `thin -p 40376 -e production -R /home/heroku_rack/heroku.ru start`
heroku[web.1]: Process exited
app[web.1]: >> Maximum connections set to 1024
app[web.1]: >> Listening on 0.0.0.0:40376, CTRL+C to stop
app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious)
heroku[web.1]: State changed from starting to up
app[web.1]:
app[web.1]: Started GET "/" for 77.236.11.34 at 2011-10-31 11:50:59-0700
app[web.1]:
app[web.1]: Processing by StoreController#index as HTML
app[web.1]: Completed 500 Internal Server Error in 4ms
app[web.1]:
app[web.1]: ActiveRecord::StatementInvalid (PGError: ERROR: relation "products" does not exist
app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
app[web.1]: WHERE a.attrelid = '"products"'::regclass
app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
app[web.1]: ORDER BY a.attnum
app[web.1]: ):
app[web.1]: app/controllers/store_controller.rb:3:in `index'
app[web.1]:
app[web.1]:
app[web.1]: cache: [GET /] miss
heroku[router]: GET eerie-meadow-9207.heroku.com/ dyno=web.1 queue=0 wait=0ms service=81ms status=500 bytes=728
heroku[nginx]: 77.236.11.34 - - [31/Oct/2011:11:50:59 -0700] "GET / HTTP/1.1" 500 728 "-" "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23" eerie-meadow-9207.heroku.com
app[web.1]:
app[web.1]:
app[web.1]: Started GET "/" for 77.236.11.34 at 2011-10-31 11:54:00-0700
app[web.1]: Processing by StoreController#index as HTML
我无法理解它,因为在我的上网本上它可以在本地主机上运行,有什么想法吗?
【问题讨论】:
-
一个解决方案:
heroku logs在控制台中了解发生了什么 -
你用了什么栈? 'heroku stack' 和哪个 rails 版本?
-
这可以是任意数量的东西。您是否查看了日志或检查了您的代码是您要根据教程输入的内容?
-
HEROKU LOGS: 2011-10-31T13:07:19+00:00 heroku[router]: Error H10 (App crashed) -> GET eerie-meadow-9207.heroku.com/dyno=队列 = 等待 = 服务 = 状态 = 503 字节 = 2011-10-31T13:07:19+00:00 heroku[nginx]: 77.236.11.34 - - [31/Oct/2011:06:07:19 -0700]" GET / HTTP/1.1" 503 607 "-" "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23" eerie- meadow-9207.heroku.com 2011-10-31T13:07:24+00:00 heroku[router]: Error H10 (App crashed) -> GET eerie-meadow-9207.heroku.com/favicon.ico dyno= queue =等待=服务=状态=503字节=
-
@apneadiving,“一个解决方案:heroku 日志...”,然后呢?对发生的事情的了解如何解决问题?日志没有显示解决方案。只有问题!
标签: ruby-on-rails heroku