我成功将应用程序部署到 Openshift,设置端口/主机/数据库。但我的应用程序仍然无法运行,而且我的 Gruntfile 似乎无法正常运行。
我在 openshift/action_hooks
中创建了名为 pre_start_nodejs
的钩子(Hook),内容如下:
#!/bin/bash
export NODE_ENV=production
# If there is a grunt file, run $ grunt prod
if [ -f "${OPENSHIFT_REPO_DIR}"/Gruntfile.js ]; then
(cd "${OPENSHIFT_REPO_DIR}"; node_modules/grunt-cli/bin/grunt prod)
fi
但是当我将代码推送到 openshift 时,它会这样说
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: 539077bd5973caf0320000d0 (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/539077bd5973caf0320000d0/nodejs)
remote: Deployment completed with status: failure
remote: postreceive failed
我还收到了有关 Sass 的警告:
remote: Warning:
remote: You need to have Ruby and Sass installed and in your PATH for this task to work.
尝试仅使用 gem install sass
安装 Sass,但看起来没有帮助。
有什么想法吗?
最佳答案
你肯定使用grunt-contrib-sass
- 对吗?
该 grunt-module 需要在服务器上安装 ruby 和 sass。
尝试
grunt-sass
相反 - 这应该有帮助。
关于node.js - 将 SailsJS 部署到 Openshift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24063832/