Rails cron whenever, bundle: command not found

后端 未结 13 1571
星月不相逢
星月不相逢 2020-12-04 17:57

I am trying to use whenever to execute a rake task onces a day. Im getting this error

/bin/bash: bundle: command not found
/home/app/.rvm/rubies/ruby-1.9.2-p         


        
13条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 18:19

    This is a ENV['PATH'] not set issue. The most elegant way to fix this is to append the rvm related scripts to the path right after the install. Add the following lines to beginning of .bashrc ( beginning and not end as when .bashrc is accessed by a non-interactive shell, the line [ -z "$PS1" ] && return throws error and the subsequent lines are not executed.

    PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
    

    and not try to explicitly set PATH and sully environment variables.

提交回复
热议问题