Almost every file changing cause 'Segmentation fault' with ruby 2.5

Hi, I’m using Middleman 4 with ruby 2.5.3(also try 2.5.1) on macOS(High Sierra - 10.13.6).
When I change and save a slim file in the project almost every time, middleman was crashed with different errors.
I also tried it on ruby 2.4.5, it works fine. So I think this is the ruby 2.5 specific problem.

Does anyone suffer from similar problems?
And does anyone know how to avoid this?

Here is the error logs and Gemfiles.

Error logs

The following part is between the first line and the third line of all logs, but this time it is omitted

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

And the ‘Control frame information’ are also limited to the first three lines

/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76: [BUG] Segmentation fault at 0x00007000086044c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0023 p:0138 s:0174 e:000169 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76
c:0022 p:0121 s:0160 e:000159 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138 [FINISH]
c:0021 p:0014 s:0146 e:000144 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/util/files.rb:124 [FINISH]
/Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:46: [BUG] Segmentation fault at 0x000070000f9394c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0039 p:0043 s:0298 e:000295 METHOD /Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:46
c:0038 p:0129 s:0290 e:000289 METHOD /Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:372
c:0037 p:0047 s:0275 e:000273 METHOD /Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:352
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93: [BUG] Segmentation fault at 0x0000700003f734c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0028 p:0019 s:0204 e:000203 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93
c:0027 p:0006 s:0197 e:000196 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:111 [FINISH]
c:0026 p:---- s:0183 e:000182 CFUNC  :reject
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:258: [BUG] Segmentation fault at 0x00007000068c04c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0033 p:---- s:0216 e:000215 CFUNC  :split
c:0032 p:0007 s:0211 e:000210 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0031 p:0013 s:0205 e:000204 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138: [BUG] Segmentation fault at 0x000070000c6644c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0077 p:0121 s:0555 e:000550 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138 [FINISH]
c:0076 p:0018 s:0537 e:000534 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/application.rb:195 [FINISH]
c:0075 p:0011 s:0530 e:000529 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/extensions/on [FINISH]
/Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:43: [BUG] Segmentation fault at 0x000070000d2674c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0022 p:---- s:0154 e:000153 CFUNC  :=~
c:0021 p:0022 s:0149 e:000148 METHOD /Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:43
c:0020 p:0052 s:0143 e:000142 METHOD /Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:360
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:258: [BUG] Segmentation fault at 0x00007000097874c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0029 p:---- s:0193 e:000192 CFUNC  :split
c:0028 p:0007 s:0188 e:000187 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0027 p:0013 s:0182 e:000181 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
^C/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93: [BUG] Segmentation fault at 0x00007000099e54c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0075 p:0019 s:0515 e:000514 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93
c:0074 p:0006 s:0508 e:000507 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:111 [FINISH]
c:0073 p:0050 s:0494 e:000492 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/extensions/ig [FINISH]
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:258: [BUG] Segmentation fault at 0x0000700004f174c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0033 p:---- s:0220 e:000219 CFUNC  :split
c:0032 p:0007 s:0215 e:000214 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0031 p:0013 s:0209 e:000208 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:266: [BUG] Segmentation fault at 0x0000700004a3c4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0088 p:---- s:0603 e:000602 CFUNC  :inject
c:0087 p:0069 s:0598 e:000597 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0086 p:0013 s:0592 e:000591 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93: [BUG] Segmentation fault at 0x000070000aa804c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0079 p:---- s:0562 e:000561 CFUNC  :ancestors
c:0078 p:0014 s:0558 e:000557 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93
c:0077 p:0006 s:0551 e:000550 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:111 [FINISH]
/Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/pathname.rb:352: [BUG] Segmentation fault at 0x00007000035484c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0018 p:---- s:0085 e:000084 CFUNC  :initialize_copy
c:0017 p:---- s:0082 e:000081 CFUNC  :initialize_dup
c:0016 p:---- s:0079 e:000078 CFUNC  :initialize
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93: [BUG] Segmentation fault at 0x0000700005c5d4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0078 p:0019 s:0558 e:000557 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93
c:0077 p:0006 s:0551 e:000550 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:111 [FINISH]
c:0076 p:0018 s:0537 e:000534 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/application.rb:195 [FINISH]
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:258: [BUG] Segmentation fault at 0x000070000204b4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0088 p:---- s:0603 e:000602 CFUNC  :split
c:0087 p:0007 s:0598 e:000597 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0086 p:0013 s:0592 e:000591 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/rb-fsevent-0.10.3/lib/otnetstring.rb:35: [BUG] Segmentation fault at 0x0000700007e4c4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0009 p:---- s:0060 e:000059 CFUNC  :read
c:0008 p:0077 s:0055 e:000054 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/rb-fsevent-0.10.3/lib/otnetstring.rb:35
c:0007 p:0376 s:0044 e:000042 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/rb-fsevent-0.10.3/lib/otnetstring.rb:54
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:258: [BUG] Segmentation fault at 0x00007000087aa4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0125 p:---- s:1064 e:001063 CFUNC  :split
c:0124 p:0007 s:1059 e:001058 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0123 p:0013 s:1053 e:001052 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/digest.rb:52: [BUG] Segmentation fault at 0x0000700005ccb4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0074 p:---- s:0516 e:000515 CFUNC  :read
c:0073 p:0027 s:0510 e:000509 BLOCK  /Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/digest.rb:52 [FINISH]
c:0072 p:---- s:0505 e:000504 CFUNC  :open
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/store.rb:222: [BUG] Segmentation fault at 0x00007000072c74c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0038 p:0009 s:0270 e:000269 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/store.rb:222
c:0037 p:0007 s:0267 e:000266 METHOD /Users/terada/.rbenv/versions/2.5.3/lib/ruby/2.5.0/monitor.rb:226
c:0036 p:0022 s:0263 e:000262 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/store.rb:221
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93: [BUG] Segmentation fault at 0x0000700001a9d4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0079 p:---- s:0562 e:000561 CFUNC  :ancestors
c:0078 p:0014 s:0558 e:000557 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93
c:0077 p:0006 s:0551 e:000550 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:111 [FINISH]
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:258: [BUG] Segmentation fault at 0x00007000103b74c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0122 p:---- s:1036 e:001035 CFUNC  :split
c:0121 p:0007 s:1031 e:001030 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0120 p:0013 s:1025 e:001024 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/util/files.rb:123: [BUG] Segmentation fault at 0x0000700005c774c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0021 p:0006 s:0147 e:000144 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/util/files.rb:123 [FINISH]
c:0020 p:---- s:0140 e:000139 CFUNC  :select
c:0019 p:0113 s:0136 e:000135 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/util/files.rb:122
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/slim-4.0.1/lib/slim/parser.rb:509: [BUG] Segmentation fault at 0x000070000cc764c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0086 p:---- s:0740 e:000739 CFUNC  :[]
c:0085 p:0054 s:0735 e:000734 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/slim-4.0.1/lib/slim/parser.rb:509
c:0084 p:0335 s:0728 e:000719 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/slim-4.0.1/lib/slim/parser.rb:437
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:258: [BUG] Segmentation fault at 0x000070000363c4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0122 p:---- s:1040 e:001039 CFUNC  :split
c:0121 p:0007 s:1035 e:001034 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0120 p:0013 s:1029 e:001028 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb:266: [BUG] Segmentation fault at 0x00007000054fb4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0033 p:---- s:0216 e:000215 CFUNC  :inject
c:0032 p:0069 s:0211 e:000210 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/inflector/methods.rb
c:0031 p:0013 s:0205 e:000204 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/string/infl
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/listen-3.0.8/lib/listen/queue_optimizer.rb:97: [BUG] Segmentation fault at 0x0000700000da54c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0016 p:---- s:0079 e:000078 CFUNC  :reject
c:0015 p:0039 s:0075 e:000074 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/listen-3.0.8/lib/listen/queue_optimizer.rb:97 [FINISH]
c:0014 p:---- s:0066 e:000065 IFUNC

Gemfile

# frozen_string_literal: true
# If you do not have OpenSSL installed, change
# the following line to use 'http://'
source 'https://rubygems.org'

gem 'middleman', '>= 4.0.0'
gem 'middleman-deploy', github: 'middleman-contrib/middleman-deploy', branch: 'master'
gem 'middleman-livereload'
gem 'slim', '>= 3.0'

Gemfile.lock

GIT
  remote: https://github.com/middleman-contrib/middleman-deploy.git
  revision: 4d04b550b4c6888265d83ee9689f41e29dbae535
  branch: master
  specs:
    middleman-deploy (2.0.0.pre.alpha)
      middleman-core (>= 3.2)
      net-sftp
      ptools

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (5.0.7.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.5.2)
      public_suffix (>= 2.0.2, < 4.0)
    backports (3.11.4)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    compass-import-once (1.0.5)
      sass (>= 3.2, < 3.5)
    concurrent-ruby (1.1.3)
    contracts (0.13.0)
    dotenv (2.5.0)
    em-websocket (0.5.1)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0.6.0)
    erubis (2.7.0)
    eventmachine (1.2.7)
    execjs (2.7.0)
    fast_blank (1.0.0)
    fastimage (2.1.5)
    ffi (1.9.25)
    haml (5.0.4)
      temple (>= 0.8.0)
      tilt
    hamster (3.0.0)
      concurrent-ruby (~> 1.0)
    hashie (3.6.0)
    http_parser.rb (0.6.0)
    i18n (0.7.0)
    kramdown (1.17.0)
    listen (3.0.8)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    memoist (0.16.0)
    middleman (4.2.1)
      coffee-script (~> 2.2)
      compass-import-once (= 1.0.5)
      haml (>= 4.0.5)
      kramdown (~> 1.2)
      middleman-cli (= 4.2.1)
      middleman-core (= 4.2.1)
      sass (>= 3.4.0, < 4.0)
    middleman-cli (4.2.1)
      thor (>= 0.17.0, < 2.0)
    middleman-core (4.2.1)
      activesupport (>= 4.2, < 5.1)
      addressable (~> 2.3)
      backports (~> 3.6)
      bundler (~> 1.1)
      contracts (~> 0.13.0)
      dotenv
      erubis
      execjs (~> 2.0)
      fast_blank
      fastimage (~> 2.0)
      hamster (~> 3.0)
      hashie (~> 3.4)
      i18n (~> 0.7.0)
      listen (~> 3.0.0)
      memoist (~> 0.14)
      padrino-helpers (~> 0.13.0)
      parallel
      rack (>= 1.4.5, < 3)
      sass (>= 3.4)
      servolux
      tilt (~> 2.0)
      uglifier (~> 3.0)
    middleman-livereload (3.4.6)
      em-websocket (~> 0.5.1)
      middleman-core (>= 3.3)
      rack-livereload (~> 0.3.15)
    minitest (5.11.3)
    net-sftp (2.1.2)
      net-ssh (>= 2.6.5)
    net-ssh (5.0.2)
    padrino-helpers (0.13.3.4)
      i18n (~> 0.6, >= 0.6.7)
      padrino-support (= 0.13.3.4)
      tilt (>= 1.4.1, < 3)
    padrino-support (0.13.3.4)
      activesupport (>= 3.1)
    parallel (1.12.1)
    ptools (1.3.5)
    public_suffix (3.0.3)
    rack (2.0.6)
    rack-livereload (0.3.17)
      rack
    rb-fsevent (0.10.3)
    rb-inotify (0.9.10)
      ffi (>= 0.5.0, < 2)
    sass (3.4.25)
    servolux (0.13.0)
    slim (4.0.1)
      temple (>= 0.7.6, < 0.9)
      tilt (>= 2.0.6, < 2.1)
    temple (0.8.0)
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.9)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)

PLATFORMS
  ruby

DEPENDENCIES
  middleman (>= 4.0.0)
  middleman-deploy!
  middleman-livereload
  slim (>= 3.0)

BUNDLED WITH
   1.17.1

Are you stuck to Middleman 4.0 for some reason? Try the current one. My current project uses:

source 'https://rubygems.org'
gem 'haml', '< 5.0.0'
gem 'middleman', '~> 4.2'
gem 'middleman-sprockets' # manually added for MM4
gem 'middleman-autoprefixer', '~> 2.8'
gem "middleman-livereload", "~> 3.4.3"
gem "middleman-search_engine_sitemap"
gem 'middleman-deploy', git: 'https://github.com/middleman-contrib/middleman-deploy', branch: 'master'

Sorry, I update my Gemfile but Gemfile.lock has not been changed other than middleman in the ‘DEPENDENCIES’ section. I already use middleman 4.2.1 the latest version.

DEPENDENCIES
  middleman (>= 4.0.0)
DEPENDENCIES
  middleman (~> 4.2)

Ah, right, I missed it in your Gemfile.lock file. The only important difference between your and my Gemfile is the Slim part. And Slim parser is part of the segmentation-fault. I guess you are using Slim (I’m using Haml). You’re on High Sierra, right?

I’ve took a look at Ruby 2.5 release notes and find some structural changes, maybe some gems are not v2.5 compatible yet but are not declared as incompatible? I’ll try to switch one of my projects to Ruby 2.5.x, maybe in the evening. I’m running Mojave now.

Thank you very much!
Yes, I’m using High Sierra (sorry, I’ve edited the post) and Slim.

I’ve found this in its document

Please remember to keep the compatibility with Ruby versions 2.0.0, 2.1.0, 2.2.0 and 2.3.0.

(it doesn’t mention to 2.4 and 2.5)

Oh my…I’ve already took times to change my template slim from haml in this time.
But I’ll try to switch back to haml!

Please let me know if you get something about this, I will also follow up in this post.

I tried with haml (remove slim gem), but it still happen, so it may not be caused by slim gem only.

Error logs

/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/sequence.rb:500: [BUG] Segmentation fault at 0x0000700003f844c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0137 p:0054 s:0957 e:000954 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/sequence.rb:500 [FINISH]
c:0136 p:---- s:0950 e:000949 IFUNC
c:0135 p:---- s:0947 e:000946 IFUNC
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/extensions/traversal.rb:31: [BUG] Segmentation fault at 0x0000700004d7d4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0103 p:0024 s:0931 e:000929 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/extensions/tr [FINISH]
c:0102 p:---- s:0926 e:000925 IFUNC
c:0101 p:---- s:0923 e:000922 CFUNC  :each
/Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93: [BUG] Segmentation fault at 0x000070000c72b4c0
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

-- Control frame information -----------------------------------------------
c:0027 p:0019 s:0201 e:000200 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/engine/base.rb:93
c:0026 p:0006 s:0194 e:000193 BLOCK  /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:111 [FINISH]
c:0025 p:0004 s:0180 e:000179 METHOD /Users/terada/Sites/example.com/vendor/bundle/ruby/2.5.0/gems/middleman-core-4.2.1/lib/middleman-core/sitemap/extensions/pr

.ruby-version

2.5.3

Gemfile

# frozen_string_literal: true
# If you do not have OpenSSL installed, change
# the following line to use 'http://'
source 'https://rubygems.org'

gem 'middleman', '~> 4.2'
gem 'middleman-deploy', github: 'middleman-contrib/middleman-deploy', branch: 'master'
gem 'middleman-livereload'

Gemfile.lock

GIT
  remote: https://github.com/middleman-contrib/middleman-deploy.git
  revision: 4d04b550b4c6888265d83ee9689f41e29dbae535
  branch: master
  specs:
    middleman-deploy (2.0.0.pre.alpha)
      middleman-core (>= 3.2)
      net-sftp
      ptools

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (5.0.7.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.5.2)
      public_suffix (>= 2.0.2, < 4.0)
    backports (3.11.4)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    compass-import-once (1.0.5)
      sass (>= 3.2, < 3.5)
    concurrent-ruby (1.1.3)
    contracts (0.13.0)
    dotenv (2.5.0)
    em-websocket (0.5.1)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0.6.0)
    erubis (2.7.0)
    eventmachine (1.2.7)
    execjs (2.7.0)
    fast_blank (1.0.0)
    fastimage (2.1.5)
    ffi (1.9.25)
    haml (5.0.4)
      temple (>= 0.8.0)
      tilt
    hamster (3.0.0)
      concurrent-ruby (~> 1.0)
    hashie (3.6.0)
    http_parser.rb (0.6.0)
    i18n (0.7.0)
    kramdown (1.17.0)
    listen (3.0.8)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    memoist (0.16.0)
    middleman (4.2.1)
      coffee-script (~> 2.2)
      compass-import-once (= 1.0.5)
      haml (>= 4.0.5)
      kramdown (~> 1.2)
      middleman-cli (= 4.2.1)
      middleman-core (= 4.2.1)
      sass (>= 3.4.0, < 4.0)
    middleman-cli (4.2.1)
      thor (>= 0.17.0, < 2.0)
    middleman-core (4.2.1)
      activesupport (>= 4.2, < 5.1)
      addressable (~> 2.3)
      backports (~> 3.6)
      bundler (~> 1.1)
      contracts (~> 0.13.0)
      dotenv
      erubis
      execjs (~> 2.0)
      fast_blank
      fastimage (~> 2.0)
      hamster (~> 3.0)
      hashie (~> 3.4)
      i18n (~> 0.7.0)
      listen (~> 3.0.0)
      memoist (~> 0.14)
      padrino-helpers (~> 0.13.0)
      parallel
      rack (>= 1.4.5, < 3)
      sass (>= 3.4)
      servolux
      tilt (~> 2.0)
      uglifier (~> 3.0)
    middleman-livereload (3.4.6)
      em-websocket (~> 0.5.1)
      middleman-core (>= 3.3)
      rack-livereload (~> 0.3.15)
    minitest (5.11.3)
    net-sftp (2.1.2)
      net-ssh (>= 2.6.5)
    net-ssh (5.0.2)
    padrino-helpers (0.13.3.4)
      i18n (~> 0.6, >= 0.6.7)
      padrino-support (= 0.13.3.4)
      tilt (>= 1.4.1, < 3)
    padrino-support (0.13.3.4)
      activesupport (>= 3.1)
    parallel (1.12.1)
    ptools (1.3.5)
    public_suffix (3.0.3)
    rack (2.0.6)
    rack-livereload (0.3.17)
      rack
    rb-fsevent (0.10.3)
    rb-inotify (0.9.10)
      ffi (>= 0.5.0, < 2)
    sass (3.4.25)
    servolux (0.13.0)
    temple (0.8.0)
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.9)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)

PLATFORMS
  ruby

DEPENDENCIES
  middleman (~> 4.2)
  middleman-deploy!
  middleman-livereload

BUNDLED WITH
   1.17.1