rails / spring-watcher-listen

MIT License
64 stars 35 forks source link

Allow Spring v4 #31

Closed afdev82 closed 2 years ago

afdev82 commented 2 years ago

Fixes #27

afdev82 commented 2 years ago

With Spring 4 I'm getting the following error if I try to run bin/rake db:migrate task:

/home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/spring-watcher-listen-1ff53e64b31f/lib/spring/watcher/listen.rb:59:in `+': no implicit conversion of Hash into Array (TypeError)
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/spring-watcher-listen-1ff53e64b31f/lib/spring/watcher/listen.rb:59:in `base_directories'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/spring-watcher-listen-1ff53e64b31f/lib/spring/watcher/listen.rb:26:in `start'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/spring-4.0.0/lib/spring/application.rb:81:in `start_watcher'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/spring-4.0.0/lib/spring/application.rb:90:in `preload'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/spring-4.0.0/lib/spring/application.rb:162:in `serve'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/spring-4.0.0/lib/spring/application.rb:144:in `block in run'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/spring-4.0.0/lib/spring/application.rb:138:in `loop'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/spring-4.0.0/lib/spring/application.rb:138:in `run'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/spring-4.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /home/antonio/.rbenv/versions/2.7.5/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        from -e:1:in `<main>'

I don't have this problem with Spring v3, so I think this gem is not compatible with Spring v4 yet.

afdev82 commented 2 years ago

I've made some tests and I can confirm that I have the error only with Spring v4.0.0

I noticed that Spring v4 inserts

load File.expand_path('../spring', __FILE__)

instead of

begin
  load File.expand_path('../spring', __FILE__)
rescue LoadError => e
  raise unless e.message.include?('spring')
end

when I run the command to "springify" the executables in my bin/ directory (bundle exec spring binstub --all). It's different from what Spring v3.1.1 did and from here.

Anyway I have the error already posted using both versions of the modified bin/rake with Spring v4.

mxdavis commented 2 years ago

👀

justin808 commented 2 years ago

Any word on when this might get released?

fcheung commented 2 years ago

I believe i've fixed this in #32

thilonel commented 2 years ago

@afdev82 @fcheung looking forward for this update! :)

afdev82 commented 2 years ago

@thilonel please refer to the PR #32 by @fcheung, thank you!