ROOT_URL 未定义 |推送导致构建失败

ROOT_URL is not defined | Pushing is causing a build failure

如果我转到构建日志,我会看到以下内容:

-----> Node.js app detected

FATAL: ROOT_URL is not defined.

 !     Push rejected, failed to compile Node.js app.

 !     Push failed

这是我在终端中得到的:

remote: Building source:
remote: 
remote: -----> Node.js app detected
remote: FATAL: ROOT_URL is not defined.
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to virtually-viral.
remote: 
To https://git.heroku.com/virtually-viral.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/virtually-viral.git'

注意:我不知道如何解决这个问题并让我的应用程序运行,我已经检查了关于有类似问题的人的多次讨论,但我无法用他们的解决方案解决它。

我对 Meteor 知之甚少,所以我不确定为什么它在开发中起作用,我也找不到它起作用所需的任何规范的关键设置列表。我能找到的最接近的是 Meteor.absoluteUrl(粗体添加)的文档:

Generate an absolute URL pointing to the application. The server reads from the ROOT_URL environment variable to determine where it is running. This is taken care of automatically for apps deployed to Galaxy, but must be provided when using meteor build.

您应该可以在 setting the ROOT_URL variable on Heroku 之前解决这个问题,例如

heroku config:set ROOT_URL=https://virtually-viral.herokuapp.com

或通过网络界面。