diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index ab3193f9e0..ba0d911fc2 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -773,7 +773,7 @@ module RbInstall remove_prefix(prefix, ruby_source) end else - [File.basename(@gemspec, '.gemspec') + '.rb'] + [@gemspec[%r[(?:[^/]+/)?[^/]+(?=\.gemspec\z)]] + '.rb'] end case File.basename(@gemspec, ".gemspec")