rails/activesupport/lib/active_support/builder.rb
Ufuk Kayserilioglu c2b195e1e3
Change load error messages to use Kernel#warn instead of $stderr.puts
When development tools try to load Rails components, they sometimes end up loading files that will error out since a dependency is missing. In these cases, the tooling can catch the error and change its behaviour.

However, since the warning is printed directly to `$stderr`, the tooling cannot catch and suppress it easily, which ends up causing noise in the output of the tool.

This change makes Rails print these warnings using `Kernel#warn` instead, which can be suppressed by the tooling.
2023-07-21 00:38:12 +03:00

9 lines
209 B
Ruby

# frozen_string_literal: true
begin
require "builder"
rescue LoadError => e
warn "You don't have builder installed in your application. Please add it to your Gemfile and run bundle install"
raise e
end