From 75d43241ddf3a175ed94ad8cfebc8278ce5a2260 Mon Sep 17 00:00:00 2001 From: Gordon Wintrob Date: Fri, 23 Jan 2026 15:54:01 -0800 Subject: [PATCH] Fix: RubyGem executable silently exits due to __FILE__ == $0 mismatch When bin/try uses require_relative to load try.rb, the __FILE__ variable in try.rb is set to try.rb path, while $0 remains bin/try path. This causes the if __FILE__ == $0 guard to fail, skipping all main execution logic. Fix by setting $0 to try.rb path before loading it, ensuring the guard condition passes. Fixes #92 Co-Authored-By: Claude Opus 4.5 --- bin/try | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/try b/bin/try index 5b722ed..4e8ecb4 100755 --- a/bin/try +++ b/bin/try @@ -1,4 +1,5 @@ #!/usr/bin/env ruby # frozen_string_literal: true -require_relative '../try' +$0 = File.expand_path('../try.rb', __dir__) +load $0