Heroku compass buildpack compass fail

二次信任 提交于 2019-12-05 09:03:42

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.

virtualandy

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.

AlexC

I ended up using "buildpack-multi"

In small details:

  1. use buildpack-multi to run Node on Heroku Cedar, otherwise it will detect the server as a Ruby stack (if I am not mistaken).

  2. 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'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!