所以我试图运行这个脚本,它在提示符下运行良好,但在 shell 脚本中失败:
rake redmine:email:receive_imap unknown_user=accept no_permission_check=1 RAILS_ENV="production" host=mail.domain.org port=993 username=helpdesk@domain.org password=XXXXXX ssl=1 move_on_success=Processed move_on_failure=Failed project=emailsupport tracker=Support subject=EmailSupport status=New
这是我尝试使用 sh /opt/redmine/scripts/redmine-rake-email.sh 运行的 .sh 文件,并且正在中止 rake!没有找到 Rakefile,我正在 /opt/redmine 目录中运行它,该目录确实有一个 Rakefile。
编辑实际上我的脚本现在看起来像这样。还是不行。
SHELL=/bin/bash
PATH=$PATH:/opt/redmine:/usr/local/bin:/usr/local/rvm/gems/ruby-1.8.7-p334/bin
cd /opt/redmine
rake redmine:email:receive_imap unknown_user=accept no_permission_check=1 RAILS_ENV="production" host=mail.domain.org port=993 username=helpdesk@domain.org password=XXXXXX ssl=1 move_on_success=Processed move_on_failure=Failed project=emailsupport tracker=Support subject=EmailSupport status=New
这是我运行 echo $PATH 时的 PATH:
/usr/local/rvm/gems/ruby-1.8.7-p334/bin:/usr/local/rvm/gems/ruby-1.8.7-p334@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p334/bin:/usr/local/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/redmine:/usr/local/bin:/usr/local/rvm/gems/ruby-1.8.7-p334/bin
我被卡住了,不确定出了什么问题。感谢您的时间。