Only with cron: /usr/bin/env: ruby_executable_hooks: No such file or directory

后端 未结 3 860
粉色の甜心
粉色の甜心 2021-01-06 18:01

I have a perl script that uses system() to call a shell command, which uses ruby_executable_hooks.

When I run this script from the command line it executes flawlessl

3条回答
  •  情话喂你
    2021-01-06 18:25

    It's almost certainly an issue with your environment variables. When running something from cron your .bashrc isn't activated, so environment variables that might set up, like which ruby version you are pointed to and what your PATH looks like are likely different.

    How to fix this will depend on your environment and what tools, if any, you might be using to select your ruby version (rvm, chruby, rbenv, etc...).

    You might want to use something like which ruby to figure out exactly what ruby to execute and use that in your crontab.

提交回复
热议问题