I am having trouble pushing to heroku, I've already tried others solutions related to Precompiling assets failed., like modifing application.rb to disable precompiled assets, running rake assets:precompile, and updating to rails 6.3.1 to prevent mimemagic recent error.
Taking a look at heroku logs, I noticed:
tmp/build_7857ebbd/vendor/bundle/ruby/3.0.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43: [BUG] Segmentation fault at 0x0000000000000000 ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Part of heroku's log
...
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 5.07s.
/tmp/build_7857ebbd/vendor/bundle/ruby/3.0.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43: [BUG] Segmentation fault at 0x0000000000000000
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0042 p:---- s:0308 e:000307 CFUNC :compile_data_context
c:0041 p:0314 s:0303 e:000302 METHOD /tmp/build_7857ebbd/vendor/bundle/ruby/3.0.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43
c:0040 p:0044 s:0291 e:000290 METHOD /tmp/build_7857ebbd/vendor/bundle/ruby/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails/compressor.rb:29
c:0039 p:0007 s:0285 e:000284 METHOD /tmp/build_7857ebbd/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/sass_compressor.rb:30
c:0038 p:0047 s:0280 e:000279 METHOD /tmp/build_7857ebbd/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:84
c:0037 p:0014 s:0272 e:000271 BLOCK /tmp/build_7857ebbd/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:66 [FINISH]
.....
c:0036 p:---- s:0267 e:000266 CFUNC :reverse_each
7f104d3bd000-7f104d3be000 rw-p 00000000 00:00 0
7fffab4a6000-7fffac4a5000 rw-p 00000000 00:00 0 [stack]
7fffac503000-7fffac505000 r--p 00000000 00:00 0 [vvar]
7fffac505000-7fffac507000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed
Based on the same thread, I found this solution more suitable than downgrading a bunch of gems.
Putting this at the top of your initializers/assets.rb enabled the assets to compile successfully
# config/initializers/assets.rb
Rails.application.config.assets.configure do |env|
env.export_concurrent = false
end
Still a hack, but another option.
Source: https://github.com/sass/sassc-ruby/issues/197#issuecomment-735359755
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With