I am trying to push a compass build-pack to heroku server, https://github.com/stephanmelzer/heroku-buildpack-nodejs-grunt-compass
It use to work until recently and I am not sure what happened on heroku side, it doens't work anymore and giving me this error :
bash: /app/.gem/ruby/1.9.1/bin/compass: /app/vendor/ruby-1.9.2/bin/ruby: bad interpreter: No such file or directory
I am not sure what happened did they change the ruby version or something
Does someone knows what can be the issue and the fix.
I use Cedar stack, running node
I'd like to add to the accepted answer with a bit more explanation since I had this exact same issue and I believe most folks will need to unset an old buildpack as follows:
First unset your old buildpack and point to the buildpack-multi:
heroku config:unset BUILDPACK_URL
heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
Buildpack multi requires you to add your own .buildpacks file. This configuration is what I ended up using successfully:
cat .buildpacks
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-ruby.git
Here's my Gemfile to pickup only Compass:
cat Gemfile
source 'https://rubygems.org'
gem 'compass'
Now you need to do:
bundle install
Which will add a Gemfile.lock
Commit everything to git and push back to heroku. This will kick in your new multi buildpack configuration and hopefully get you back up and running. You should see both the nodejs and ruby buildpacks download serially per above configuration.
Disclaimer: This is likely time-sensitive material as heroku might very well change something over the upcoming months.
I could not get the multi buildpacks to work with my app, but I was able to get the buildpack located at https://github.com/stephanmelzer/heroku-buildpack-nodejs-grunt-compass to work with Heroku once again:
In bin/compile, I added
cp -r /app/vendor/ruby-1.9.2 $build_dir/vendor
right after the script checked the cache and either updated or installed compass and before it cached the ruby gems.
EDIT
Well, I was mistaken. In our case, the compass:dist
task was failing due to some bad SASS. And that eventually kicked out this error. In my shotgun approach to fixing it, I edited the Gruntfile heroku task to this:
grunt.registerTask('heroku', function () {
grunt.log.warn('The `heroku` task has been deprecated. Use `grunt build` to build for deployment.');
grunt.task.run(['compass:dist']);
});
When this ran on deploy to heroku, I noticed the error.
I also switched buildpacks. I'm now using this buildpack which seems to work okay. Sorry, a little confusing, but hope that helps.
Orig answer below.
Not a true answer but since I can't yet comment...
Seeing this error as well. I think it has to do with this line in that heroku-node-compass buildpack that we are using.
I tried adding ruby: 2.0.0
to my Gemfile
but that didn't make a difference.
I ended up using "buildpack-multi"
In small details:
use buildpack-multi to run Node on Heroku Cedar, otherwise it will detect the server as a Ruby stack (if I am not mistaken).
Having Node and Ruby multipack allows me to install Compass from the Ruby Gem, using these instructions.
The answers here seem outdated.
According to the latest docs https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app you can specify multiple buildpacks from the command line for your app:
heroku buildpacks:set heroku/ruby
heroku buildpacks:add heroku/nodejs
This will make sure that we first run ruby. then afterwards we run and launch the node app. Compass is then available.
Just add a Gemfile with:
source 'https://rubygems.org'
gem 'compass'
来源:https://stackoverflow.com/questions/25091012/heroku-compass-buildpack-compass-fail