railsbump / app

Check which gems are compatible with which Rails version!
https://railsbump.org
MIT License
152 stars 20 forks source link

Deploy to Heroku fails #48

Closed manuelmeurer closed 4 years ago

manuelmeurer commented 4 years ago

When I try to deploy to Heroku, the Boostrap SCSS files in node_modules cannot be found:

Objekte aufzählen: 11, Fertig.
Zähle Objekte: 100% (11/11), Fertig.
Delta-Kompression verwendet bis zu 12 Threads.
Komprimiere Objekte: 100% (7/7), Fertig.
Schreibe Objekte: 100% (7/7), 36.71 KiB | 4.59 MiB/s, Fertig.
Gesamt 7 (Delta 5), Wiederverwendet 0 (Delta 0), Pack wiederverwendet 0
remote: Git submodules detected, installing:
remote: Submodule 'common-gems' (https://github.com/krautcomputing/common-gems.git) registered for path 'common-gems'
remote: Cloning into 'common-gems'...
remote: Submodule path 'common-gems': checked out '22094a8053b3510b3c2b6621ffd8fcff3e7880fc'
remote:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.0.2
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.6.5
remote: -----> Installing dependencies using bundler 2.0.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching gem metadata from https://rubygems.org/............
remote:        Using rake 13.0.1
[snip]
remote:        Removing actionmailer (6.0.2.1)
remote:        Bundle completed (188.55s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v10.15.3-linux-x64
remote: -----> Installing yarn-v1.16.0
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        SassC::SyntaxError: Error: File to import not found or unreadable: bootstrap/scss/functions.
remote:                on line 8:1 of app/assets/stylesheets/partials/_bootstrap.scss
remote:                from line 1:1 of app/assets/stylesheets/application.scss
remote:        >> @import "bootstrap/scss/functions";
remote:
remote:           ^
remote:        /tmp/build_66051c98a1162bc2f3c3f5392824ba71/app/assets/stylesheets/partials/_bootstrap.scss:8
remote:        /tmp/build_66051c98a1162bc2f3c3f5392824ba71/vendor/bundle/ruby/2.6.0/gems/sassc-2.3.0/lib/sassc/engine.rb:50:in `render'
[snip]
remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote:
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to railsbump.
remote:
To https://git.heroku.com/railsbump.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: Fehler beim Versenden einiger Referenzen nach 'https://git.heroku.com/railsbump.git'

When i run rake assets:precompile locally, everything works fine.

I suspect that Heroku doesn't run yarn install first, so the node_modules folder is not present when rake assets:precompile is called.

@etagwerker Do you maybe know what's going on?

manuelmeurer commented 4 years ago

Indeed yarn install wasn't run. This was solved by adding the nodejs buildpack.