2

I managed to deploy application to Openshift, set port/host/db. But my app isn't working still, and it looks like my Gruntfile isn't run properly.

I have created hook inside openshift/action_hooks called pre_start_nodejs, with following content:

#!/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

but when I push my code to openshift, it says this

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

I also receive this warning regardin Sass:

remote: Warning: 
remote: You need to have Ruby and Sass installed and in your PATH for this task to work.

Tried to install Sass with just gem install sass, but looks like it didn't help.

Any ideas?

zabumba
  • 12,172
  • 16
  • 72
  • 129
Ned
  • 3,961
  • 8
  • 31
  • 49

1 Answers1

1

You surely use grunt-contrib-sass - right? That grunt-module need ruby and sass installed on the server.

try

grunt-sass

instead - that should help.

zabumba
  • 12,172
  • 16
  • 72
  • 129
mdunisch
  • 3,627
  • 5
  • 25
  • 41
  • yes, "grunt-contrib-sass" is installed. I tried using package that you proposed, and locally it works fine, but on the server it's not installed, here's what I got. http://paste.ofcode.org/8Hcbs8Qw3AL82s4tdqq8eS – Ned Jun 06 '14 at 09:04
  • you have to replace grunt-contrib-sass with grunt-sass in your package.json and push the new package.json – mdunisch Jun 06 '14 at 10:12
  • yes, exactly what I did, but somehow node-sass can't be installed on remote server. I'm trying to find solution for that now :/ – Ned Jun 06 '14 at 11:05
  • post you complete log plz – mdunisch Jun 06 '14 at 13:37
  • here's the longer log http://paste.ofcode.org/FbvMDERe5FZX6VeXCSUJMz, hope that now I pasted everything that could help. i'm still wrapping my head around it. – Ned Jun 06 '14 at 13:43
  • I deleted application and deployed it again. Looks like something different is happening, but again node-sass.http://paste.ofcode.org/eMvRvuzz4uqNXhWeKS3xjB – Ned Jun 06 '14 at 14:49
  • Hmm seems to be a bug at node-sass (dep of grunt-sass). Can you please check what version is installed at local? (see: node_modules/grunt-sass/node_modules/node-sass/package.json) I have 0.8.6 (make npm install grunt-sass a day ago). – mdunisch Jun 06 '14 at 15:28
  • mine is "version": "0.9.1" locally. I'll try with that one. Strange is that it works locally, but on server it fails while installing. – Ned Jun 06 '14 at 15:43
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/55212/discussion-between-user3351722-and-ned). – mdunisch Jun 06 '14 at 15:48
  • Thanks to @user3351722, I managed to deploy it successfully, by defining older version of grunt-sass (0.12.1). – Ned Jun 09 '14 at 07:53