何时/为什么将--env-shebang与红宝石宝石一起使用? [英] When/why to use --env-shebang with ruby gems?
问题描述
Ikenna Okpala推荐了此.gemrc
(我稍加修改了):
Ikenna Okpala recommended this .gemrc
(I modified it slightly):
---
:verbose: true
:bulk_threshold: 1000
install: --no-ri --no-rdoc --env-shebang
:sources:
- http://gems.rubyforge.org/
:benchmark: false
:backtrace: false
update: --no-ri --no-rdoc --env-shebang
:update_sources: true
我以前没有注意到--env-shebang
.我在 http://guides.rubygems.org/command-reference/中查找了--env-shebang
的文档. :
I had not noticed the --env-shebang
before. I looked up the documentation for --env-shebang
at http://guides.rubygems.org/command-reference/:
Install/Update Options:
...
-E, --[no-]env-shebang - Rewrite the shebang line on installed scripts to use /usr/bin/env
实际上,为什么--env-shebang
选项可能很重要? (我从未使用过.)
Practically speaking, why might the --env-shebang
option be important? (I've never used it.)
推荐答案
如果出于某种原因,宝石的作者未使用#!/usr/bin/env ruby
,则您可能希望自动更改它.
If for some reason the gem's author didn't use #!/usr/bin/env ruby
you may well want to have it automatically changed.
((如果您要问为什么根本不希望使用env
shebang行,请此对其进行解释很好.)
(If you're asking why you'd want the env
shebang line at all, this explains it pretty well.)
rubygems-developers线程讨论此功能的想法的开始是
The beginning of the rubygems-developers thread discussing the idea for this feature is here.
这篇关于何时/为什么将--env-shebang与红宝石宝石一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!