bkeepers / dotenv

A Ruby gem to load environment variables from `.env`.
MIT License
6.6k stars 506 forks source link

follow-up https://github.com/bkeepers/dotenv/pull/511/ #512

Closed alpaca-tc closed 2 months ago

alpaca-tc commented 2 months ago

An exception occurs when invoking the rake task via ./bin/rails.

bin/rails aborted!
NoMethodError: undefined method `watch' for Spring:Module (NoMethodError)

    Spring.watch event.payload[:env].filename if Rails.application
          ^^^^^^
.bundle/ruby/3.2.0/gems/dotenv-3.1.3/lib/dotenv/rails.rb:16:in `block in <main>'

When using ./bin/rails, 'spring/client' is loaded, but 'spring/watcher', which is unnecessary for the client-side, is not required.

This PR follows up on https://github.com/bkeepers/dotenv/pull/511/ and fixes exception.

bkeepers commented 2 months ago

Thanks @alpaca-tc, I'll push out a release shortly.