为什么我总是需要“ruby”在“脚本/运行程序”前面?
当我执行 script/runner
时,它会给我 -bash: script/runner: Permission returned
当我执行 sudo script/runner
时,它会给我sudo:script/runner:找不到命令
它仅在我执行ruby script/runner
时才有效。为什么?在其他地方,我看到人们只是运行 script/runner
,而前面没有 ruby
......对此有“修复”吗?这导致我的 javan-whenever 生成的 crontab 在权限被拒绝
上失败,因为它只运行script/runner
而没有ruby
...
When I do just script/runner
it gives me -bash: script/runner: Permission denied
When I do sudo script/runner
it gives me sudo: script/runner: command not found
It only works when I do ruby script/runner
. Why? Everywhere else I see people just run script/runner
without the ruby
in front of it... Is there a "fix" for this? It's causing my javan-whenever generated crontab to fail on Permission denied
because it just runs script/runner
without ruby
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您的
script/runner
文件上未设置“执行”权限位。如果该位未设置,unix shell 将不会尝试执行它。可以使用
chmod +x script/runner
来设置它。man chmod
了解有关 chmod 命令的更多详细信息。It sounds like the "execute" permission bit is not set on your
script/runner
file. If that bit is not set, the unix shells will not try to execute it.chmod +x script/runner
can be used to set it.man chmod
for more details on the chmod command.就这样做
然后它就会运行。它基本上使它成为可执行文件。
使用
以获取更多详细信息
just do this
and it would run. It basically makes it a executable.
use
to get more details