我正在Heroku上运行Node.js / Express / MongoHQ应用程序。它在当地完美运作。当我推送到Heroku时,根页面'/'正确加载并且成功访问MongoHQ数据库。每个其他路由都给我一个内部服务器错误,并且在Heroku日志中没有可识别的错误。虽然如果我去/ page /我确实让我的应用程序的500页正确呈现(随机......)
有什么你能想到的可能会出错吗?我认为这是一个数据库的东西,但现在它似乎是一个路由的东西。我很高兴提供任何代码......我想我会粘贴一些日志,虽然它对我来说非常无益。任何想法MAJORYL赞赏。
感谢。
记录(基本上是除了'/'以外的任何路径)
2011-10-07T17:27:03+00:00 app[web.1]: 10.94.69.43 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_js/lib/jquery.1.4.2.min.js HTTP/1.1" 304 - "<MYSITE>/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/lib/jquery.timeago.js dyno=web.1 queue=0 wait=0ms service=5ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/lib/jquery.1.4.2.min.js dyno=web.1 queue=0 wait=0ms service=7ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/lib/iscroll.js dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_css/viewer.css dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/utils.js dyno=web.1 queue=0 wait=0ms service=2ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.117.9.191 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_js/lib/iscroll.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 app[web.1]: 10.117.11.66 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_css/viewer.css HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_js/mediacreate.js dyno=web.1 queue=0 wait=0ms service=2ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.94.74.117 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /assets_js/mediacreate.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/view_dashboard/activecard.js dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.84.93.33 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_dashboard/activecard.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/view_dashboard/drawon.js dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/assets_css/dashboard.css dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.64.155.131 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_dashboard/dashboard.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 heroku[router]: GET <MYSITE>/view_presentation/cards/cards.js dyno=web.1 queue=0 wait=0ms service=8ms status=304 bytes=0
2011-10-07T17:27:03+00:00 app[web.1]: 10.84.95.29 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_presentation/cards/cards.js HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:03+00:00 app[web.1]: 10.64.155.131 - - [Fri, 07 Oct 2011 17:27:03 GMT] "GET /view_presentation/cards/cards.css HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:05+00:00 app[web.1]: 10.64.147.7 - - [Fri, 07 Oct 2011 17:27:05 GMT] "GET /assets_img/graph.gif HTTP/1.1" 304 - "<MYSITE>" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:05+00:00 heroku[router]: <MYSITE>/assets_img/graph.gif dyno=web.1 queue=0 wait=0ms service=6ms status=304 bytes=0
2011-10-07T17:27:05+00:00 app[web.1]: 10.84.95.29 - - [Fri, 07 Oct 2011 17:27:05 GMT] "GET /favicon.ico HTTP/1.1" 500 1682 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
2011-10-07T17:27:05+00:00 heroku[router]: GET <MYSITE>/favicon.ico dyno=web.1 queue=0 wait=0ms service=5ms status=500 bytes=1682
答案 0 :(得分:1)
我能想到的一些可能性:
node --version
找到你的,然后将这样的内容添加到package.json中,以使heroku使用相同的版本:"engines": { "node": "0.6.14"}
npm ls
以查看您在本地拥有的内容,并在您查看下载的版本时注意heroku的日志。git status
如果您有.gitignore
和.slugignore
文件,请检查这些文件。require('os').type()
和require('os').release()
可以在这里提供一些信息。答案 1 :(得分:0)
当我部署到Heroku时,我遇到了类似的问题。原来我的文件名在现场打破了代码,但不在本地。
例如,我有一个名为createSession.hbs的视图。在我的路线(createSession.js)中我正在做
res.render('createsession', {...});
在本地,首都'S'并不重要,但在部署时,我收到了内部服务器错误。
我的本地操作系统是Windows,我部署在Heroku(Ubuntu服务器)上。
愚蠢且恼人的错误,因为它在本地工作,但希望它可以帮助某人。