why #!/usr/bin/env ruby doesn't work in crontab?

后端 未结 3 2029
半阙折子戏
半阙折子戏 2021-01-12 03:40

I have install ruby by rvm (system-wide), and worked correctly via normal console and my rails program is behaving correctly with both rails runner and ap

3条回答
  •  无人共我
    2021-01-12 04:12

    If you installed ruby via rvm, ruby probably isn't in /usr/bin. Depending on where rvm is installed:

    bash -c "source /usr/local/lib/rvm" && rails runner foo.bar
    

    You probably added a source */rvm to your bashrc that is the correct rvm loading script.

提交回复
热议问题