rerun
rerun copied to clipboard
Use `RbConfig.ruby` to invoke ruby executable
On Windows,If we use rbenv for Windows, rerun ./app.rb
and rerun ruby ./app.rb
will not work, because it seem directly call ruby.exe
.
rbenv for Windows
has make ruby.exe
a fake stub (not the real ruby.exe), so the method above won't work. So, how about making the invocation using RbConfig.ruby
to get an absolute path?
irb(main):001:0> RbConfig.ruby
=> "C:/Ruby-on-Windows/3.2.0-1/bin/ruby.exe"