0

我正在开发一个网站,它应该向 iOS 设备发送推送通知。我按照本教程发送通知。在我的 localhost apnagent 上工作正常,但是当我git push访问我的 Openshift 云时,我在终端中收到以下错误:

remote: Waiting for application port (8080) become available ...
remote: Application 'apnagent' failed to start (port 8080 not available)
remote: -------------------------
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: 55c3344c89f5cf720xxxxxxx (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/55c3344c89f5cf720xxxxxxx/nodejs
remote: #<IO:0x00000000f1c278>
remote: #<IO:0x00000000f1c200>
remote: )
remote: Deployment completed with status: failure
remote: postreceive failed
To ssh://55c3344c89f5cf720xxxxxxx@apnagent-xxxxxxx.rhcloud.com/~/git/apnagent.git/
   bbcf2a3..87exxxx  master -> master

我的 package.json 看起来像这样:

{
  "private": true,
  "name": "apnagent",
  "version": "0.0.0",
  "dependencies": {
    "apnagent": "1.0.x"
  },
  "engines": {
    "node": ">=0.10.22",
    "npm": ">=1.3.14"
  },
  "scripts": {
    "start": "node agent/_header.js"
  },
  "main": "agent/_header.js"
}

我想我应该以某种方式process.env.OPENSHIFT_NODEJS_PORT用作服务器上的端口,或者类似的东西。我敢肯定,我犯了一些配置错误,因为在我的本地机器上一切正常。

4

1 回答 1

1

你检查服务器上的日志了吗?SSH 进入您的应用并使用

less app-root/logs/nodejs.log

并按 shift+g 查看服务器最近的控制台输出。我的脚本中有一些语法错误,它们导致了类似的错误。

如果这没有帮助,您可以发布您的服务器脚本吗?

于 2015-08-17T14:15:39.040 回答