在 crontab 添加 0 */1 * * * /xxx/rebuild_index.sh > /www/reindex.log 2>&1 任务并打印日志。
/xxx/rebuild_index.sh的内容为:
#! /bin/bash
export LC_ALL=en_US.UTF-8
export PATH='/usr/local/bin':$PATH
cd /www/app
RAILS_ENV=production /usr/local/bin/rake sunspot:reindex
日志报错为:
rake aborted!
LoadError: cannot load such file -- bundler/setup
/www/app/config/boot.rb:3:in <top (required)>'
/www/app/config/application.rb:1:in
'
/www/app/Rakefile:4:in `'
(See full trace by running task with --trace)
求大神指点一二