我正在尝试将一个reveal.js应用程序部署到Heroku。Reveal.js通过
最初,由于compass是
Procfile包含
作为最后一次尝试,我尝试使用Heroku-nodejs-grunt构建包(https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt),它将在部署时运行grunt任务以编译资产。仍然没有成功,
当开始使用新的grunt构建包时,我遇到了上面的Gruntfile.js错误,提示“process”未定义。我将端口切换为0。
我无法弄清楚如何让Heroku将grunt serve用作我的主要Web服务器进程!
grunt connect
命令在node上运行。该应用程序还需要ruby来即时编译资产。在本地,我可以使用grunt serve
运行应用程序。最初,由于compass是
grunt watch
的依赖项,因此Heroku只检测到Gemfile并假定我正在运行ruby应用程序。我使用了nodejs自定义构建包,强制Heroku将其视为nodejs应用程序。Procfile包含
web: grunt serve
日志显示
2013-06-17T13:51:56.187012+00:00 heroku[router]: at=error code=H14 desc="No web processes running"
heroku ps
也没有显示任何内容。 我可以成功运行“heroku run grunt serve”,并且我已经修改了默认的Gruntfile.js以接受process.env,即:
connect: {
server: {
options: {
port: process.env.PORT || 8000,
base: '.'
}
}
}
作为最后一次尝试,我尝试使用Heroku-nodejs-grunt构建包(https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt),它将在部署时运行grunt任务以编译资产。仍然没有成功,
heroku logs --tail
仍然没有显示任何进程正在运行。通过heroku run
进行探索发现grunt可用,并且grunt serve
命令成功执行。当开始使用新的grunt构建包时,我遇到了上面的Gruntfile.js错误,提示“process”未定义。我将端口切换为0。
没有效果,尝试使用“?”也没有效果(仍然没有Web进程,Web服务器将响应的端口。如果指定的端口已在使用中,则该任务将失败。您可以使用特殊值0或“?”来使用系统分配的端口。
heroku restart
没有任何作用)我无法弄清楚如何让Heroku将grunt serve用作我的主要Web服务器进程!