For example, I have a gem called mygem and I want to start executable file with a command mygem
.
How can I do this?
Here is the RubyGems guide for how to add an executable.
The primary steps are:
/bin
directorychmod a+x bin/<yourfile>
.executables
section of your gemspecNote you will still have to build and install your gem locally to run the command without a path as you are trying to do in the screenshot.
More info in building executable gems.