the crontab entry was :
* * * * cd /var/www/html/metajorn && RAILS_ENV=production 
/usr/local/bin/rake myraketask --trace >> 
/var/www/html/metajorn/log/cron_log.log 2>&1

I changed the name to myapp just in the post ... but omitted to change 
it in the  error trace.

So, yes when run manually it works just fine and file permissions are 
set to 777.
I think it is related to some environment information that are not 
loaded by cron ... but I haven't find yet what is exactly missing.



Colin Law wrote:
> On 13 July 2010 15:50, med addame <[email protected]> wrote:
>> I have a rails rake task which runs just fine. I want this task to be
>> run periodically by crontab so I added it to crontab as follows : 0,30,0
>> * * * * cd /var/www/html/myapp && RAILS_ENV=production
>> /usr/local/bin/rake myraketask --trace >>
>> /var/www/html/myapp/log/cron_log.log 2>&1
> 
> If you type exactly that command (from the cd obviously) into a
> terminal, does it work?  Do you have permission to write into the log
> directory?  Though can't see why that would give that error.
> 
>>
>> In cron_log.log I'm seeing the following error:
>>
>> rake aborted!
>> invalid byte sequence in US-ASCII
>> /var/www/html/metajorn/config/boot.rb:98:in `parse_gem_version'
> 
> Are you sure this is as a result of the command above?  It seems to be
> in the wrong directory.
> 
> What is in line 98 of boot.rb?
> 
> Colin

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to