From 719abdb1a4881d65831830e6e6fb5ca1bcedbc1e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 17 Aug 2022 02:45:08 +0200 Subject: [PATCH] Mention all the requirements for MiniRacer on TruffleRuby (#257) Raise there instead of waiting for the `@context.eval` below, for a clearer error. --- lib/mini_racer/truffleruby.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mini_racer/truffleruby.rb b/lib/mini_racer/truffleruby.rb index bfb7088..3be4892 100644 --- a/lib/mini_racer/truffleruby.rb +++ b/lib/mini_racer/truffleruby.rb @@ -71,7 +71,9 @@ module MiniRacer end unless Polyglot.languages.include? "js" - warn "You also need to install the 'js' component with 'gu install js' on GraalVM 22.2+", uplevel: 0 if $VERBOSE + raise "The language 'js' is not available, you likely need to `export TRUFFLERUBYOPT='--jvm --polyglot'`\n" \ + "You also need to install the 'js' component with 'gu install js' on GraalVM 22.2+\n" \ + "Note that you need TruffleRuby+GraalVM and not just the TruffleRuby standalone to use MiniRacer" end @context = Polyglot::InnerContext.new(on_cancelled: -> {