Cron may have a different PATH set than the user account. It's
possible that date isn't in that PATH. In this case the string
would be null, and a command not found message would be sent to
STDERR.
You can confirm this by replacing 'date' with 'which date' in your
task above and then looking at the resulting output.
Shawn
On Dec 1, 2007 4:30 PM, Aryk Grosz <[EMAIL PROTECTED]> wrote:
>
> I have a simple rake script which looks like this
>
> task :test => :environment do
> response = %x{date}
> puts 1
> puts response
> puts 2
> end
>
> When I run this directly from the command line, I get the correct
> output.
>
> However, when I call this rake task from cron, it gives me:
>
> 1
>
> 2
>
> as the output.
>
>
> What am I missing here? STDOUT seems to be written as nil or empty
> string. Why is this happening?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Deploying Rails" 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-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---