Skip to content
  • Hartley McGuire's avatar
    e3f80f62
    Add lower bound to Listen gem requirement · e3f80f62
    Hartley McGuire authored
    An issue was recently opened with the following error message:
    
    ```
    .../activesupport-7.0.6/lib/active_support/evented_file_update_checker.rb:120:in `start': undefined method `wait_for_state' for #<Listen::Listener ...>
    ```
    
    The issue is that the user was using Listen 3.0.8, however the
    `wait_for_state` method was [added][1] in Listen 3.3.0
    
    We can make the error message a little better by defining a lower bound
    on Listen 3.3.0 (like we do for other optional dependencies):
    
    ```
    .../bundler/rubygems_integration.rb:280:in `block (2 levels) in replace_gem': can't activate listen (~> 3.3), already activated listen-3.0.8. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
    ```
    
    There is definitely still room for improvement here, but this should
    be much more helpful in figuring out that the issue is a bad Listen
    version and not a bug in Rails.
    
    [1]: https://github.com/guard/listen/commit/12b4fc54a965f6a07c71bd53207ce8be8b0d7869
    e3f80f62
    Add lower bound to Listen gem requirement
    Hartley McGuire authored
    An issue was recently opened with the following error message:
    
    ```
    .../activesupport-7.0.6/lib/active_support/evented_file_update_checker.rb:120:in `start': undefined method `wait_for_state' for #<Listen::Listener ...>
    ```
    
    The issue is that the user was using Listen 3.0.8, however the
    `wait_for_state` method was [added][1] in Listen 3.3.0
    
    We can make the error message a little better by defining a lower bound
    on Listen 3.3.0 (like we do for other optional dependencies):
    
    ```
    .../bundler/rubygems_integration.rb:280:in `block (2 levels) in replace_gem': can't activate listen (~> 3.3), already activated listen-3.0.8. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
    ```
    
    There is definitely still room for improvement here, but this should
    be much more helpful in figuring out that the issue is a bad Listen
    version and not a bug in Rails.
    
    [1]: https://github.com/guard/listen/commit/12b4fc54a965f6a07c71bd53207ce8be8b0d7869
Loading