【问题标题】:Deploying SailsJS to Openshift将 SailsJS 部署到 Openshift
【发布时间】:2014-06-05 15:09:14
【问题描述】:

我设法将应用程序部署到 Openshift,设置端口/主机/数据库。但是我的应用程序仍然无法运行,而且我的 Gruntfile 似乎运行不正常。

我在openshift/action_hooks 内部创建了名为pre_start_nodejs 的钩子,内容如下:

#!/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,但似乎没有帮助。

有什么想法吗?

【问题讨论】:

    标签: node.js sass openshift sails.js


    【解决方案1】:

    您肯定使用grunt-contrib-sass - 对吧? 那个 grunt-module 需要在服务器上安装 ruby​​ 和 sass。

    试试

    grunt-sass
    

    相反 - 这应该会有所帮助。

    【讨论】:

    • 是的,“grunt-contrib-sass”已安装。我尝试使用您提出的软件包,并且在本地它工作正常,但在服务器上它没有安装,这就是我得到的。 paste.ofcode.org/8Hcbs8Qw3AL82s4tdqq8eS
    • 你必须在你的 package.json 中用 grunt-sass 替换 grunt-contrib-sass 并推送新的 package.json
    • 是的,正是我所做的,但不知何故 node-sass 无法安装在远程服务器上。我现在正在尝试找到解决方案:/
    • 请给你完整的日志
    • 这里是更长的日志paste.ofcode.org/FbvMDERe5FZX6VeXCSUJMz,希望现在我粘贴了所有可以提供帮助的内容。我还在纠结。
    猜你喜欢
    • 2014-08-02
    • 1970-01-01
    • 1970-01-01
    • 2015-07-20
    • 1970-01-01
    • 1970-01-01
    • 2013-03-25
    • 2014-03-18
    • 1970-01-01
    相关资源
    最近更新 更多