Open the bin file and look at its contents. It should be just a plain Ruby file. Somewhere towards the end you will usually see something like this:
load Gem.bin_path('gemname', 'gemname', version)
Where gemname
will be the name of the gem the file belongs to.
If a line like that is not present, you will have to do a bit of detective work, but usually you can figure it out from either the bin name, or the code that is in the file itself.
You can also quickly verify bin
contents of a specific gem like this, which may help in tracking down candidates:
gem contents gemname | grep bin
Or if you just want to scan everything:
gem contents --all | grep file_you_want_to_find