Rake aborted! cannot load such file -- /var/www/redmine/Rakefile


Dear all,

I have installed a redmine server, all is running except when I try to
run this task with cron.

The rakefile is in the path and it works when i run the command manually
in the terminal.


here are my configuration details
Redmine version 2.3.1.stable
Ruby version 1.9.3 (i486-linux)
Rails version 3.2.13
Environment production
Database adapter Mysql2
Redmine plugins:
no plugin installed

when I run whereis rake, i have the following output

and this is my cron task that I set via my user - crontab -e

cd /var/www/redmine/ && /usr/local/bin/rake redmine:email:receive_imap
RAILS_ENV=“production” host=mail..ch username=support2@****
password=**** port=143 project=support allow_override=project
unknown_user=accept --trace

I have also tried this one
cd /var/www/redmine/ && /usr/local/bin/rake -f
redmine:email:receive_imap RAILS_ENV=“production” host=mail..ch
**** password=**** port=143 project=support
allow_override=project unknown_user=accept --trace

here is the email that sent the cron daemon

From: root@redmine (Cron Daemon)
To: redmine@redmine
Subject: Cron redmine@REDMINE cd /var/www/redmine/ &&
/usr/local/bin/rake redmine:email:receive_imap RAILS_ENV=“production”
host=mail..ch username=support2@.org password=** port=143
project=winmedia-support allow_override=project unknown_user=accept
Content-Type: text/plain; charset=UTF-8
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/redmine>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=redmine>
Message-Id: E1UpFI6-0005pj-9x@REDMINE
Date: Wed, 19 Jun 2013 12:07:02 +0200

rake aborted!
cannot load such file – /var/www/redmine/Rakefile
load' /var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:inload_rakefile’
raw_load_rakefile' /var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:89:inblock in load_rakefile’
standard_exception_handling' /var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:88:inload_rakefile’
block in run' /var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:instandard_exception_handling’
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in run' /var/lib/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in<top (required)>’
/usr/local/bin/rake:23:in load' /usr/local/bin/rake:23:in

here is my bundle list if it can help

*** LOCAL GEMS ***

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
builder (3.0.4, 3.0.0)
bundler (1.3.5)
capybara (2.0.3)
childprocess (0.3.9)
coderay (1.0.9)
daemon_controller (1.1.4)
erubis (2.7.0)
ffi (1.9.0)
hike (1.2.3)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.0.3)
json (1.8.0)
mail (2.5.4)
metaclass (0.0.1)
mime-types (1.23)
mini_portile (0.5.0)
mocha (0.13.3)
multi_json (1.7.6)
mysql2 (0.3.11)
net-ldap (0.3.1)
nokogiri (1.6.0)
passenger (4.0.5)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack-openid (1.3.1)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
rake (10.0.4)
rdoc (4.0.1, 3.12.2)
rmagick (2.13.2)
ruby-openid (2.1.8)
rubyzip (0.9.9)
selenium-webdriver (2.33.0)
shoulda (3.3.2)
shoulda-context (1.0.2)
shoulda-matchers (1.4.1)
sprockets (2.2.2)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.14)
tzinfo (0.3.37)
websocket (1.0.7)
xpath (1.0.0)
yard (

do you have any idea or logs that I can check?

Thanks for your time and your help I really would like to make it work.


Try running these cron with bundle exec