1

I am trying to deploy a node js application to heroku with BUILDPACK_URL.I have searched for the solution of my problem but didn't get any suitable answer for my problem.

Here is procedure the i followed:

 heroku create myapp
 heroku config:add BUILDPACK_URL='https://github.com/stephanmelzer/heroku-buildpack-nodejs-grunt-compass.git'

Then i commit my changes and then:

git push heroku master

It runs fine beforegrunt task started.I have installed compass gem to work with grunt . When the heroku tries to start grunt task i got below error:

`remote: -----> Installing Compass
 remote: WARNING:  You don't have /tmp/build_2f866d4293332f62a9a9aa576a411628/.gem/ruby/2.2.0/bin in your PATH,
 remote:gem executables will not run.

`

After that warning i got a message that compass installed successfully

remote: Building native extensions.  This could take a while...
remote: Successfully installed ffi-1.9.10
remote: Successfully installed rb-inotify-0.9.5
remote: Successfully installed rb-fsevent-0.9.5
remote: Successfully installed chunky_png-1.3.4
remote: Successfully installed sass-3.4.16
remote: Successfully installed compass-import-once-1.0.5
remote: Successfully installed compass-core-1.0.3
remote:     Compass is charityware. If you love it, please donate on   our behalf at http://umdf.org/compass Thanks!
remote: Successfully installed compass-1.0.3
remote: 8 gems installed

Then after heroku tries to run `grunt'. Here at this point i got bellow error:

remote: -----> Running grunt heroku:production task
remote: Running "env:src" (env) task
remote: 
remote: Running "clean:dist" (clean) task
remote: 
remote: Running "compass:dist" (compass) task
remote: Warning: You need to have Ruby and Compass installed and in  your system PATH for this task to work. More info:   https://github.com/gruntjs/grunt-contrib-compass Use --force to continue.
remote: 
remote: Aborted due to warnings.

I don't why its not finding PATH for compass gem which is already installed in my local machine.

which compass
result:  /home/username/.rvm/gems/ruby-2.2.0-preview1/bin/compass

can any one tell how to overcome this problem and set PATH variable of the gem correctly .

Thank you very much.

monsur
  • 601
  • 6
  • 18
  • Try `heroku config:add BUILDPACK_URL=https://github.com/[account]/heroku-buildpack-multi.git` instead, see if that works. [From here](http://stackoverflow.com/questions/15890076/how-to-setup-gruntfile-to-use-compass-sass-on-heroku). – Andy Aug 13 '15 at 11:41
  • I have tried that but no luck. Thank you very much for the response. – monsur Aug 13 '15 at 11:58

2 Answers2

1

I just looked in the buildback source and see in that twice in bin/compile it refers to ruby 1.9.1. Both times to set an environment variable.

Perhaps heroku upgraded the version of ruby in the node buildpack?

I would fork the repo and change the values to the 2.2.0 path values that are being looked for.

You have only to change the paths in the buildpack, or follow the instructions in the comment.

Robert Moskal
  • 21,737
  • 8
  • 62
  • 86
  • Thank you.That might be a reason .Mean while heroku is looking for ruby 2.2.0. – monsur Aug 13 '15 at 11:59
  • The key point is `remote: WARNING: You don't have /tmp/build_8786c086fcd09993475156f9d8f6a63a/.gem/ruby/2.2.0/bin in your PATH` I guess what i need to do is to set the correct `**path**` of heroku ruby binary installation so that my node app can communicate with`compass` gem.But i have no idea how to set up `PATH` in heroku. – monsur Aug 13 '15 at 14:17
1

I just started having this exact problem too, not sure when heroku changed to ruby 2.2.0. Here is a quick fork of the buildpack I made that fixed the PATH problem, https://github.com/adamgoldstein/heroku-buildpack-nodejs-grunt-compass.

You can change your buildpack on the command line with: heroku buildpacks:set https://github.com/adamgoldstein/heroku-buildpack-nodejs-grunt-compass

Adam
  • 11
  • 1