0

iOS デバイスにプッシュ通知を送信する Web サイトを開発しています。このチュートリアルに従って、通知を送信しました。私のローカルホストでは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