diff options
author | Charles Oliver Nutter <[email protected]> | 2022-01-26 23:29:17 -0600 |
---|---|---|
committer | git <[email protected]> | 2022-01-27 17:16:05 +0900 |
commit | f511ff3b3af4e70877538b911fde27c57792fc1d (patch) | |
tree | 5d1a76016dc1b45bb178b4407e7b29a331ac831d /lib/yaml.rb | |
parent | e89d80702bd98a8276243a7fcaa2a158b3bfb659 (diff) |
[ruby/yaml] Add JRuby-specific warning when psych fails
The error here is confusing for users because JRuby does not use
libyaml and installing it will not help. Instead, JRuby directs
them to a wiki page that describes an issue when multiple
conflicting versions of SnakeYAML are installed.
This change allows us to use the yaml gem and delete our local
sources.
https://github.com/ruby/yaml/commit/8122087ffb
Diffstat (limited to 'lib/yaml.rb')
-rw-r--r-- | lib/yaml.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/yaml.rb b/lib/yaml.rb index 17b27e802f..6d5d5ebd4c 100644 --- a/lib/yaml.rb +++ b/lib/yaml.rb @@ -3,9 +3,17 @@ begin require 'psych' rescue LoadError - warn "It seems your ruby installation is missing psych (for YAML output).\n" \ - "To eliminate this warning, please install libyaml and reinstall your ruby.\n", - uplevel: 1 + case RUBY_ENGINE + when 'jruby' + warn "The Psych YAML extension failed to load.\n" \ + "Check your env for conflicting versions of SnakeYAML\n" \ + "See https://github.com/jruby/jruby/wiki/FAQs#why-does-the-psych-yaml-extension-fail-to-load-in-my-environment", + uplevel: 1 + else + warn "It seems your ruby installation is missing psych (for YAML output).\n" \ + "To eliminate this warning, please install libyaml and reinstall your ruby.\n", + uplevel: 1 + end raise end |