在Heroku上运行Dart App

Pet*_*ete 2 heroku dart

我正在关注此博客,将Dart应用程序上传到Heroku并运行它.我已经到了将应用程序成功部署到Heroku的程度,但该应用程序未运行.以下是Heroku日志:

2012-12-20T18:04:57+00:00 heroku[web.1]: Starting process with command `dart TestApp.dart`
2012-12-20T18:04:57+00:00 app[web.1]: bash: dart: command not found
2012-12-20T18:04:58+00:00 heroku[web.1]: Process exited with status 127
2012-12-20T18:04:58+00:00 heroku[web.1]: State changed from starting to crashed
Run Code Online (Sandbox Code Playgroud)

以下是我的内容 Procfile

web: dart TestApp.dart
Run Code Online (Sandbox Code Playgroud)

任何人都可以指出我对这个错误的解决方案吗?

Ale*_*uin 5

您应该忘记将buildpack添加到配置中.查看Heroku Buildpack for Dart入门.

基本上,您必须使用以下命令:

$> heroku create myapp_name -s cedar
$> heroku config:add BUILDPACK_URL=https://github.com/igrigorik/heroku-buildpack-dart.git
Run Code Online (Sandbox Code Playgroud)

警告:使用最新版本的buildpack似乎dart命令不再是PATH.解决方法是使用完整路径Procfile:

web: ./dart-sdk/bin/dart TestApp.dart
Run Code Online (Sandbox Code Playgroud)

  • 刚刚找到了解决方法.查看编辑的答案. (2认同)