summaryrefslogtreecommitdiff
path: root/lib/prism/translation/ruby_parser.rb
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-05-13 12:31:47 -0400
committergit <[email protected]>2024-05-13 16:31:55 +0000
commitb5e53e2f32e19e826eacbf9e2e301b1deae146df (patch)
treeafa0ed9b9c8045170ccf9f4ffd97d21dc765cdd0 /lib/prism/translation/ruby_parser.rb
parent5931f857abf704c6fc62a93d2fc933b13950392d (diff)
[ruby/prism] Rescue LoadError for ruby_parser as well
https://github.com/ruby/prism/commit/d4eb13e703
Diffstat (limited to 'lib/prism/translation/ruby_parser.rb')
-rw-r--r--lib/prism/translation/ruby_parser.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb
index d01a762a03..43aac23be7 100644
--- a/lib/prism/translation/ruby_parser.rb
+++ b/lib/prism/translation/ruby_parser.rb
@@ -1,6 +1,11 @@
# frozen_string_literal: true
-require "ruby_parser"
+begin
+ require "ruby_parser"
+rescue LoadError
+ warn(%q{Error: Unable to load ruby_parser. Add `gem "ruby_parser"` to your Gemfile.})
+ exit(1)
+end
module Prism
module Translation