File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -88,14 +88,19 @@ def _install_ruby(ctx, ruby):
8888
8989def host_ruby_is_correct_version (ctx , version ):
9090 interpreter_path = ctx .which ("ruby" )
91+
9192 if not interpreter_path :
93+ print ("Can't find ruby interpreter in the PATH" )
9294 return False
9395
94- ruby_version = ctx .execute (["ruby" , "--version" ]).stdout
95- version_string = "ruby %sp" % version
96+ ruby_version = ctx .execute (["ruby" , "-e" , "print RUBY_VERSION" ]).stdout
97+
98+ have_ruby_version = (version == ruby_version )
99+
100+ if have_ruby_version :
101+ print ("Found local Ruby SDK version '%s' which matches requested version '%s'" % (ruby_version , version ))
96102
97- print ("Checking for version '%s' in '%s'" % (version_string , ruby_version ))
98- return version_string in ruby_version
103+ return have_ruby_version
99104
100105def _ruby_runtime_impl (ctx ):
101106 # If the current version of ruby is correct use that
You can’t perform that action at this time.
0 commit comments