diff options
author | Arthur Nogueira Neves <github@arthurnn.com> | 2016-03-08 11:46:13 -0500 |
---|---|---|
committer | Arthur Nogueira Neves <github@arthurnn.com> | 2016-03-08 11:46:13 -0500 |
commit | 8c2a697380e9661563fb545bc860c4f1abe94bcd (patch) | |
tree | 59b86e8c0f8a160114691326301edbc53226e859 | |
parent | 6ef5c64ab8353fd82fc13989e07cda86da5a1efa (diff) | |
parent | 78dd3f6f96d1daa6bb7a1ddf14b1a39b71b08319 (diff) | |
download | rails-8c2a697380e9661563fb545bc860c4f1abe94bcd.tar.gz rails-8c2a697380e9661563fb545bc860c4f1abe94bcd.tar.bz2 rails-8c2a697380e9661563fb545bc860c4f1abe94bcd.zip |
Merge pull request #24067 from jch/error-message-when-missing-listen-dependency
Friendly error message if missing `listen` development dependency
-rw-r--r-- | activesupport/lib/active_support/evented_file_update_checker.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/evented_file_update_checker.rb b/activesupport/lib/active_support/evented_file_update_checker.rb index 63f4f7e277..6a02a838b7 100644 --- a/activesupport/lib/active_support/evented_file_update_checker.rb +++ b/activesupport/lib/active_support/evented_file_update_checker.rb @@ -21,7 +21,13 @@ module ActiveSupport # Loading listen triggers warnings. These are originated by a legit # usage of attr_* macros for private attributes, but adds a lot of noise # to our test suite. Thus, we lazy load it and disable warnings locally. - silence_warnings { require 'listen' } + silence_warnings do + begin + require 'listen' + rescue LoadError => e + raise LoadError, "Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile", e.backtrace + end + end Listen.to(*dtw, &method(:changed)).start end end |