diff --git a/lib/better_errors/error_page_style.rb b/lib/better_errors/error_page_style.rb index ff1cb858..b5c15d88 100644 --- a/lib/better_errors/error_page_style.rb +++ b/lib/better_errors/error_page_style.rb @@ -2,7 +2,20 @@ module BetterErrors # @private module ErrorPageStyle def self.compiled_css(for_deployment = false) - require "sassc" + begin + require "sassc" + rescue LoadError + raise LoadError, "The `sassc` gem is required when developing the `better_errors` gem. "\ + "If you're using a release of `better_errors`, the compiled CSS is missing from the released gem" + # If you arrived here because sassc is not in your project's Gemfile, + # the issue here is that the release of the better_errors gem + # is supposed to contain the compiled CSS, but that file is missing from the release. + # So better_errors is trying to build the CSS on the fly, which requires the sassc gem. + # + # If you're developing the better_errors gem locally, and you're running a project + # that does not have sassc in its bundle, run `rake style:build` in the better_errors + # project to compile the CSS file. + end style_dir = File.expand_path("style", File.dirname(__FILE__)) style_file = "#{style_dir}/main.scss"