I wish to place a shell script in my gem's bin dir, along with other Ruby programs that belong to the package. I wish to have this shell script installed in the bin directory as-is (that is, no wrappers). Is that possible with Ruby gems at all? I would be happy with post-install hooks if not otherwise possible. Anybody has any experience with this?
相关问题
- How does the setup bootstrapper detect if prerequi
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
- reference to a method?
- ruby 1.9 wrong file encoding on windows
相关文章
- Ruby using wrong version of openssl
- Getting errors / failing tests when installing Pyt
- How do you make an installer for your python progr
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- “No explicit conversion of Symbol into String” for
- Segmentation fault with ruby 2.0.0p247 leading to
- How to detect if an element exists in Watir
This issue is described here: https://github.com/rubygems/rubygems/issues/88
If the gem you're developing is intended only for your own use, you can simply install it with
I think you'd best write a ruby script which runs your bash script. Here's an example on how to do that:
bin/test_gem
bin/test_gem.sh
test_gem.gemspec
NOTE: Don't forget to set both files in the
bin
folder to executable!Note that while
test_gem.sh
is registered with thefiles
Rubygems command, it's not registered asexecutables
: it will just be placed in the installed gem's dir but not wrapped/shimmed.If you install your gem (and run rbenv rehash if necessary), calling
test_gem
will result in the ruby script executing your shell script.