Hi! I’m having some trouble getting past this issue building an out-of-the-box Rails 7.1.2 project, and I’m hoping some smart person will be kind enough to point me in the right direction.
The short version: A project built with rails new blog -c bootstrap
and docker build -t blog .
fails to precompile with the errors below. The same docker build
command appears to work without error if the project is built with tailwind
instead of bootstrap
.
The errors:
postcss ./app/assets/builds/application.css --use=autoprefixer --output=./app/assets/builds/application.css
12.29 Segmentation fault
ERROR: failed to solve: process "/bin/sh -c SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile" did not complete successfully: exit code: 1
Steps to reproduce
→ ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin23]
→ rails --version
Rails 7.1.2
→ yarn --version
1.22.19
→ rails new blog -c bootstrap
(appears to work without problems)
→ cd blog
→ docker build -t blog .
(some output truncated)
=> [build 8/9] RUN bundle exec bootsnap precompile app/ lib/ 1.5s
=> ERROR [build 9/9] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile 12.7s
------
> [build 9/9] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile:
5.035 yarn install v1.22.19
5.276 [1/4] Resolving packages...
5.443 success Already up-to-date.
5.494 Done in 0.47s.
5.991 yarn run v1.22.19
6.161 $ yarn build:css:compile && yarn build:css:prefix
6.816 $ sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules
12.35 $ postcss ./app/assets/builds/application.css --use=autoprefixer --output=./app/assets/builds/application.css
12.52 Segmentation fault
12.54 error Command failed with exit code 139.
12.54 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12.57 error Command failed with exit code 139.
12.57 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12.61 bin/rails aborted!
12.61 cssbundling-rails: Command build failed, ensure `yarn build:css` runs without errors
12.61
12.61 Tasks: TOP => assets:precompile => css:build
12.61 (See full trace by running task with --trace)
------
Dockerfile:50
--------------------
48 |
49 | # Precompiling assets for production without requiring secret RAILS_MASTER_KEY
50 | >>> RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
51 |
52 |
--------------------
ERROR: failed to solve: process "/bin/sh -c SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile" did not complete successfully: exit code: 1
1 Like
For any other folks out there struggling with this problem, in my case it turned out to be a docker issue.
On Docker desktop, Settings > General
Select gRPC FUSE
instead of VirtioFS
, which I believe is the default
Uncheck Use Virtualization framework
Open a new terminal tab, and build again:
docker build --no-cache -t blog .
2 Likes
tagrudev
(Todor Grudev)
December 9, 2023, 3:24pm
3
I just created an account to tell you that after spending like 12 hours last night on this issue, I found your post and this actually worked. Thank you so much man.
3 Likes
pgb
(pgb)
December 28, 2023, 11:50am
4
I’m getting a similar crash using Ruby 3.3.0 and Rails 7.1.2 when building the docker image on a Mac.
I’ve tried disabling VirtIO with no luck, it still segfaults when building the image.
Here’s the entire log of the error I get:
root@bab1754d67cc:/rails# SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14: [BUG] Segmentation fault at 0x0062ffff87c706c0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]
-- Control frame information -----------------------------------------------
c:0102 p:---- s:0581 e:000580 CFUNC :resume
c:0101 p:0007 s:0577 E:001ba0 BLOCK /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14 [FINISH]
c:0100 p:---- s:0574 e:000573 CFUNC :synchronize
c:0099 p:0026 s:0570 E:001fc8 METHOD /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12
c:0098 p:0007 s:0565 e:000564 CLASS /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:18
c:0097 p:0025 s:0562 e:000561 TOP /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:5 [FINISH]
c:0096 p:---- s:0559 e:000558 CFUNC :require
c:0095 p:0030 s:0554 e:000553 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0094 p:0158 s:0548 e:000547 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0093 p:0041 s:0538 e:000537 TOP /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:7 [FINISH]
c:0092 p:---- s:0535 e:000534 CFUNC :require
c:0091 p:0030 s:0530 e:000529 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0090 p:0158 s:0524 e:000523 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0089 p:0047 s:0514 e:000513 TOP /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomics.rb:8 [FINISH]
c:0088 p:---- s:0511 e:000510 CFUNC :require
c:0087 p:0030 s:0506 e:000505 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0086 p:0158 s:0500 e:000499 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0085 p:0029 s:0490 e:000489 TOP /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent.rb:6 [FINISH]
c:0084 p:---- s:0487 e:000486 CFUNC :require
c:0083 p:0030 s:0482 e:000481 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0082 p:0158 s:0476 e:000475 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0081 p:0005 s:0466 e:000465 TOP /usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo/string_deduper.rb:4 [FINISH]
c:0080 p:---- s:0463 e:000462 CFUNC :require_relative
c:0079 p:0025 s:0458 e:000457 TOP /usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo.rb:25 [FINISH]
c:0078 p:---- s:0455 e:000454 CFUNC :require
c:0077 p:0030 s:0450 e:000449 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0076 p:0158 s:0444 e:000443 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0075 p:0005 s:0434 e:000433 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/values/time_zone.rb:3 [FINISH]
c:0074 p:---- s:0431 e:000430 CFUNC :require
c:0073 p:0030 s:0426 e:000425 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0072 p:0158 s:0420 e:000419 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0071 p:0017 s:0410 e:000409 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/time/conversions.rb:5 [FINISH]
c:0070 p:---- s:0407 e:000406 CFUNC :require
c:0069 p:0030 s:0402 e:000401 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0068 p:0158 s:0396 e:000395 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0067 p:0065 s:0386 e:000385 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/object/json.rb:14 [FINISH]
c:0066 p:---- s:0383 e:000382 CFUNC :require
c:0065 p:0030 s:0378 e:000377 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0064 p:0158 s:0372 e:000371 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0063 p:0005 s:0362 e:000361 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json/encoding.rb:3 [FINISH]
c:0062 p:---- s:0359 e:000358 CFUNC :require
c:0061 p:0030 s:0354 e:000353 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0060 p:0158 s:0348 e:000347 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0059 p:0011 s:0338 e:000337 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json.rb:4 [FINISH]
c:0058 p:---- s:0335 e:000334 CFUNC :require
c:0057 p:0030 s:0330 e:000329 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0056 p:0158 s:0324 e:000323 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0055 p:0011 s:0314 e:000313 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/metadata.rb:4 [FINISH]
c:0054 p:---- s:0311 e:000310 CFUNC :require_relative
c:0053 p:0011 s:0306 e:000305 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/codec.rb:4 [FINISH]
c:0052 p:---- s:0303 e:000302 CFUNC :require
c:0051 p:0030 s:0298 e:000297 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0050 p:0158 s:0292 e:000291 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0049 p:0023 s:0282 e:000281 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/message_encryptor.rb:6 [FINISH]
c:0048 p:---- s:0279 e:000278 CFUNC :require
c:0047 p:0030 s:0274 e:000273 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0046 p:0158 s:0268 e:000267 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0045 p:0017 s:0258 e:000257 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_file.rb:5 [FINISH]
c:0044 p:---- s:0255 e:000254 CFUNC :require
c:0043 p:0030 s:0250 e:000249 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0042 p:0158 s:0244 e:000243 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0041 p:0011 s:0234 e:000233 TOP /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_configuration.rb:4 [FINISH]
c:0040 p:---- s:0231 e:000230 CFUNC :require
c:0039 p:0030 s:0226 e:000225 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0038 p:0158 s:0220 e:000219 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0037 p:0041 s:0210 e:000209 TOP /usr/local/bundle/gems/railties-7.1.2/lib/rails/application.rb:9 [FINISH]
c:0036 p:---- s:0207 e:000206 CFUNC :require
c:0035 p:0030 s:0202 e:000201 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0034 p:0158 s:0196 e:000195 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0033 p:0059 s:0186 e:000185 TOP /usr/local/bundle/gems/railties-7.1.2/lib/rails.rb:15 [FINISH]
c:0032 p:---- s:0183 e:000182 CFUNC :require
c:0031 p:0030 s:0178 e:000177 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0030 p:0158 s:0172 e:000171 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0029 p:0005 s:0162 e:000161 TOP /usr/local/bundle/gems/railties-7.1.2/lib/rails/all.rb:5 [FINISH]
c:0028 p:---- s:0159 e:000158 CFUNC :require
c:0027 p:0030 s:0154 e:000153 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0026 p:0158 s:0148 e:000147 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0025 p:0011 s:0138 e:000137 TOP /rails/config/application.rb:3 [FINISH]
c:0024 p:---- s:0135 e:000134 CFUNC :require
c:0023 p:0030 s:0130 e:000129 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0022 p:0158 s:0124 e:000123 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0021 p:0011 s:0114 e:000113 TOP /rails/rakefile:4 [FINISH]
c:0020 p:---- s:0111 e:000110 CFUNC :load
c:0019 p:0005 s:0106 e:000105 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:29
c:0018 p:0143 s:0101 e:000100 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:734
c:0017 p:0003 s:0095 e:000094 BLOCK /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:126
c:0016 p:0002 s:0092 e:000091 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:208
c:0015 p:0004 s:0087 e:000086 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:125
c:0014 p:0021 s:0083 e:000082 BLOCK /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:43
c:0013 p:0023 s:0079 e:000078 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:59
c:0012 p:0021 s:0073 e:000072 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:41
c:0011 p:0010 s:0066 e:000065 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:20
c:0010 p:0032 s:0059 e:000058 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:156
c:0009 p:0035 s:0052 e:000051 BLOCK /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:73
c:0008 p:0015 s:0049 e:000048 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:149
c:0007 p:0048 s:0043 e:000042 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:69
c:0006 p:0038 s:0032 e:000031 TOP /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands.rb:18 [FINISH]
c:0005 p:---- s:0027 e:000026 CFUNC :require
c:0004 p:0030 s:0022 e:000021 BLOCK /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0003 p:0158 s:0016 e:000015 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0002 p:0024 s:0006 e:000005 EVAL ./bin/rails:4 [FINISH]
c:0001 p:0000 s:0003 E:0015e0 DUMMY [FINISH]
-- Ruby level backtrace information ----------------------------------------
./bin/rails:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands.rb:18:in `<main>'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:69:in `invoke'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:149:in `with_argv'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:73:in `block in invoke'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:156:in `invoke_rake'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:59:in `with_application'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:43:in `block in with_rake'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:125:in `load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:208:in `standard_exception_handling'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:126:in `block in load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:734:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:29:in `load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:29:in `load'
/rails/rakefile:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/rails/config/application.rb:3:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/all.rb:5:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails.rb:15:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/application.rb:9:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_configuration.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_file.rb:5:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/message_encryptor.rb:6:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/codec.rb:4:in `<main>'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/codec.rb:4:in `require_relative'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/metadata.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json/encoding.rb:3:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/object/json.rb:14:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/time/conversions.rb:5:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/values/time_zone.rb:3:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo.rb:25:in `<main>'
/usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo.rb:25:in `require_relative'
/usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo/string_deduper.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent.rb:6:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomics.rb:8:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:7:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:5:in `<main>'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:18:in `<module:Concurrent>'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12:in `mutex_owned_per_thread?'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12:in `synchronize'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14:in `block in mutex_owned_per_thread?'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14:in `resume'
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1
-- Machine register context ------------------------------------------------
x0: 0x0000aaab1f5ddb50 x1: 0x0000aaab2042d190 x2: 0x0000fffff93a8060
x3: 0x0000ffff6d96ff60 x4: 0x0000ffff6d970018 x5: 0x0000ffff6d990000
x6: 0x0000ffff881c0b88 x7: 0x0000000000000000 x18: 0x0000000000000000
x19: 0x0000000000000000 x20: 0x0000000000000000 x21: 0x0000000000000000
x22: 0x0000000000000000 x23: 0x0000000000000000 x24: 0x0000000000000000
x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
x28: 0x0000000000000000 x29: 0x0000000000000000 sp: 0x0000ffff6d970000
fau: 0x0062ffff87c706c0
-- C level backtrace information -------------------------------------------
Segmentation fault
2 Likes
ArcticLeo
(ArcticLeo)
January 3, 2024, 12:25am
5
@pgb FYI I’m having the exact same issue with Ruby 3.3.0 and Rails 7.1.2 and unfortunately @tagrudev ’s fix didn’t work for me either.
1 Like
pgb
(pgb)
January 3, 2024, 3:10pm
6
Apparently this is an issue with Ruby to be fixed in 3.3.1 (see here )
1 Like
ArcticLeo
(ArcticLeo)
January 3, 2024, 4:25pm
7
@pgb Ah! Thank you for following up on that. That makes it easy to work around and to know what to wait for.
2 Likes
I am having the same problem with Rails 7.1.3 and Ruby 3.2.2.
@campfire , thanks a lot for saving my day!
Update: After all, changing to gRPC without Virtualization framework didn’t work too. I’m Mac OS Sonoma 14.3.1
1 Like
nickj
(Nick)
June 11, 2024, 1:56am
11
@jonibatista
There a two different issues at play here I think, one is those with a version of Ruby < 3.3.2, and the other issue, is those with…wait for it …drumroll …you guessed it, Apple Silicon
I had this issue, and none of the above approaches fixed this, until I stopped trying to build on platform “linux/amd64” when I have an M3 macbook.
Stopped dead in its tracks at the bundle exec bootsnap precompile
step, until I removed the incorrect platform reference docker build -t imagenamegoeshere --platform linux/amd64 .
Changed it to: docker build -t imagenamegoeshere .
and it worked fine.
Summary of it is, definitely related to the build platform being used.
1 Like
@campfire ’s solution worked for me, thanks!!