node.js - 将 SailsJS 部署到 Openshift

标签 node.js sass openshift sails.js

我成功将应用程序部署到 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/

相关文章:

ruby - 错误 : spawn ENOENT: missing the sass executable

openshift - "jx boot"在 "openshift-3.11"提供程序中失败,"tekton pipeline controller"pod 进入 "crashloopbackoff"状态

node.js - Nodejs 服务器脚本未知结果

javascript - 如何使用 Node 检查器,Windows 7 调试带有断点的 Gruntfile?

css - Bootstrap-sass 在 Rails 应用程序中不起作用

css - 尝试制作将主要内容推出屏幕的移动 Canvas 外滑出

javascript - 从 OpenShift Mongodb 保存文档

java - 如何从其他 openshift 帐户访问 openshift 上托管的 mysql 数据库

node.js - 如果其中任何一个任务出错,async.parallel 是否仍会在所有任务完成后调用最终回调?

node.js - 在 9.2.0 中创建 Node NPM 模块以支持旧版本的 Node