Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Script runs fine alone but not when called by cron (EPIPE)

Reply
Thread Tools

Script runs fine alone but not when called by cron (EPIPE)

 
 
Otto __
Guest
Posts: n/a
 
      10-11-2008
Hey, I'm still learning ruby (first week) and I'm having problem with a
script that sends an e-mail.
The script (~/teste_email.rb) runs fine when I call it, but raises and
exception when ran as a cron task.

This is the stack trace:
----------
`write': Broken pipe (Errno::EPIPE)
from /usr/lib/ruby/1.8/net/protocol.rb:139:in `<<'
from /usr/lib/ruby/1.8/net/protocol.rb:139:in `rbuf_consume'
from /usr/lib/ruby/1.8/net/protocol.rb:118:in `readuntil'
from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
from /usr/lib/ruby/1.8/net/smtp.rb:664:in `recv_response'
from /usr/lib/ruby/1.8/net/smtp.rb:551:in `send0'
from /usr/lib/ruby/1.8/net/smtp.rb:686:in `critical'
from /usr/lib/ruby/1.8/net/smtp.rb:548:in `send0'
... 7 levels...
from
/var/lib/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer/base.rb:414:in
`deliver'
from /home/otto/send_gmail.rb:60:in `send_gmail'
from /home/otto/teste_mail.rb:5:in `envia_email'
from /home/otto/teste_mail.rb:8
----------


I got send_gmail.rb from this website:
http://codingfrenzy.alexpmay.com/200...lone-ruby.html

Why does it run fine when I call it myself and how do I make it run ok
from cron?

Thanks in advance
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      10-13-2008
2008/10/11 Otto __ <(E-Mail Removed)>:
> Hey, I'm still learning ruby (first week) and I'm having problem with a
> script that sends an e-mail.
> The script (~/teste_email.rb) runs fine when I call it, but raises and
> exception when ran as a cron task.
>
> This is the stack trace:
> ----------
> `write': Broken pipe (Errno::EPIPE)
> from /usr/lib/ruby/1.8/net/protocol.rb:139:in `<<'
> from /usr/lib/ruby/1.8/net/protocol.rb:139:in `rbuf_consume'
> from /usr/lib/ruby/1.8/net/protocol.rb:118:in `readuntil'
> from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
> from /usr/lib/ruby/1.8/net/smtp.rb:664:in `recv_response'
> from /usr/lib/ruby/1.8/net/smtp.rb:551:in `send0'
> from /usr/lib/ruby/1.8/net/smtp.rb:686:in `critical'
> from /usr/lib/ruby/1.8/net/smtp.rb:548:in `send0'
> ... 7 levels...
> from
> /var/lib/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer/base.rb:414:in
> `deliver'
> from /home/otto/send_gmail.rb:60:in `send_gmail'
> from /home/otto/teste_mail.rb:5:in `envia_email'
> from /home/otto/teste_mail.rb:8
> ----------
>
>
> I got send_gmail.rb from this website:
> http://codingfrenzy.alexpmay.com/200...lone-ruby.html
>
> Why does it run fine when I call it myself and how do I make it run ok
> from cron?


You do not give near as much detail as needed to properly answer your
question. Though chances are that the reason lies in different
environments. Things to look for are PATH and LD_LIBRARY_PATH.

Cheers

robert


--
remember.guy do |as, often| as.you_can - without end

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script runs manually, but cron fails Bryan Python 3 07-27-2009 02:40 PM
script runs ok alone, broken pipe when piped to head? Dave Burns Ruby 5 03-16-2008 09:40 PM
app runs fine with interpreter, but not under py2exe Doug Morse Python 10 03-16-2008 11:01 AM
Runs Fine In Perl :: Not As Cron Job Bucker Perl Misc 6 01-17-2007 03:19 PM
VC++ 6 ___ EXE file runs fine on one computer but not the other jimmy_sayavong@yahoo.com C++ 4 01-09-2006 06:52 PM



Advertisments