我正在尝试将示例应用程序从this Dart教程部署到Heroku。我完全按照步骤操作,实际上,随着git push heroku master
完成,部署似乎成功了:
http://houseofdart.herokuapp.com deployed to Heroku
To git@heroku.com:houseofdart.git
但是,当我随后尝试访问该应用程序的Heroku URL时,出现应用程序错误消息“该应用程序中发生了错误,无法为您的页面提供服务。请稍后再试。如果您是应用程序所有者,请检查详细信息。” 现在,对于日志,我可以看到其中有些警报,但是我不知道如何解决。这是我的heroku日志(为简便起见,仅粘贴了一部分):
2014-02-05T01:08:59.029794+00:00 heroku[web.1]: Starting process with command `./dart-sdk/bin/dart bin/basic_http_server.dart`
2014-02-05T01:08:59.050211+00:00 heroku[web.1]: Starting process with command `./dart-sdk/bin/dart bin/basic_http_server.dart`
2014-02-05T01:08:59.845661+00:00 app[web.1]: Unable to open file: /app/bin/basic_http_server.dart
2014-02-05T01:09:00.064575+00:00 app[web.1]: Unable to open file: /app/bin/basic_http_server.dart
2014-02-05T01:09:01.134177+00:00 heroku[web.1]: Process exited with status 255
2014-02-05T01:09:01.761486+00:00 heroku[web.1]: Process exited with status 255
2014-02-05T01:09:01.144540+00:00 heroku[web.1]: State changed from starting to crashed
2014-02-05T01:09:01.145311+00:00 heroku[web.1]: State changed from crashed to starting
2014-02-05T01:09:02.927148+00:00 heroku[web.1]: Starting process with command `./dart-sdk/bin/dart bin/basic_http_server.dart`
2014-02-05T01:09:03.696680+00:00 app[web.1]: Unable to open file: /app/bin/basic_http_server.dart
2014-02-05T01:09:04.793026+00:00 heroku[web.1]: Process exited with status 255
2014-02-05T01:09:04.808956+00:00 heroku[web.1]: State changed from starting to crashed
2014-02-05T01:09:57.277242+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=houseofdart.herokuapp.com request_id=78cc25ea-964a-4bfe-95a4-cf09437a22ad fwd="178.43.176.145" dyno= connect= service= status=503 bytes=
不知道为什么无法打开/app/bin/basic_http_server.dart吗?
根据Dart教程,我的代码只是从here下载的,我的Procfile看起来应该像这样:
web: ./dart-sdk/bin/dart bin/basic_http_server.dart
我也尝试按照Seth Ladd的博客中的步骤进行(很抱歉,StackOverflow不允许我粘贴第三个链接,但是Google“使用Heroku在云中运行Dart”,您会收到我正在谈论的帖子),但也没有运气-更糟糕的是,推送被拒绝了,并且我收到的错误消息是
You need to specify DART_SDK_URL to a Dart SDK for Linux
,因此我想教程说明是最新的。这可能是什么问题?
最佳答案
正如我所怀疑的,这实际上不是Dart还是Heroku的问题。答案非常简单:我将bin /文件夹添加到了〜/ .gitignore_global 文件中,将其删除后一切正常。
谢谢MarioP,因为您的建议确实为我指明了正确的方向,当然,您建议的命令根本没有显示任何bin /文件夹。
关于heroku - 尝试在Dart中访问应用程序的Heroku URL时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21567257/