Heroku - 应用程序错误

ruh*_*gry 8 ruby-on-rails heroku

我用Ruby on Rails创建了简单的应用程序,我试图在Heroku上提交它.我已经按照Heroku上的入门指南,我完成了它并尝试打开我的页面,但我仍然看到一个错误:应用程序错误:

应用程序中发生错误,无法提供您的页面.请稍后重试.

如果您是应用程序所有者,请检查日志以获取详细信息.

有谁知道如何处理它?


我不知道发生了什么,但我已经完成了这一步,不幸的是我有另一个问题,我运行了一些命令:

#git的补充.
#git的承诺-m"我承诺"
在分公司主没有提交(工作目录干净)
#混帐推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
Run Code Online (Sandbox Code Playgroud)

我无法理解它,因为在我的上网本上它适用于localhost,任何想法?

小智 19

尝试使用该命令

heroku run rake db:migrate


Ari*_*jan 14

尝试重新启动您的应用heroku restart.假设您的应用在本地运行正常,这应该可以解决问题.它为我解决了这个问题,因为我只重构了模式,db:reset似乎没有做到这一点.


dem*_*tal 5

大多数时候heroku问题是由于缺乏访问文件系统的权限.为了使您的应用程序能够在heroku上运行,您必须确保它不会尝试将任何内容写入磁盘(但在临时文件夹中).

典型的例子是js/css编译过程,例如使用罗盘,您可以在其知识数据库中找到解决方案:http://devcenter.heroku.com/articles/using-compass

您应该在heroku日志中进一步查看应用程序启动时或第一次请求期间是否存在任何"权限被拒绝"问题.