Forum: Ruby on Rails RailsCron 0.2 questions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gerret A. (Guest)
on 2006-01-28 11:09
(Received via mailing list)
Hi all, I've set up RailsCron to send email reminders on a daily
basis. My dev environment is Rails trunk on Debian Sarge, lighttpd
running as a regular user.

I'm having two issues:

1) When I run "rake cron_start", I get

rake aborted!
undefined method `blank?' for "":String

The "blank?" method is provided by Rails, so I'm guessing its not
available in Rake's context for some reason. In looking for the cause,
I used Rails1.0 (via gem) instead of the svn rails trunk. Now I don't
get the error, and the RailsCron background job starts just fine. I
can't figure why --
$RAILS_TRUNK/activesupport/lib/active_support/core_ext/blank.rb does
define String#blank?

2) in $RAILS_CRON/tasks/startup.rake, system calls to ruby are
prefixed with "sudo -u #{ENV['USER']}". On my deployment host I won't
be a sudoer. For now I've simply removed the "sudo" portion of each
command, and it seems to work. Am I inadvertently breaking something?
Why the 'sudo'?

3) When a rails_cron process is started, "ps" doesn't list it for me.
"ps a" does. Should I expect simply "ps" to work (as its written in
startup.rake) ?

cheers
Gerret
Kyle M. (Guest)
on 2006-01-28 20:45
(Received via mailing list)
On 1/28/06, Gerret A. <removed_email_address@domain.invalid> wrote:
>
> The "blank?" method is provided by Rails, so I'm guessing its not
> available in Rake's context for some reason. In looking for the cause,
> I used Rails1.0 (via gem) instead of the svn rails trunk. Now I don't
> get the error, and the RailsCron background job starts just fine. I
> can't figure why --
> $RAILS_TRUNK/activesupport/lib/active_support/core_ext/blank.rb does
> define String#blank?

I have only tested against 1.0.

>
> 2) in $RAILS_CRON/tasks/startup.rake, system calls to ruby are
> prefixed with "sudo -u #{ENV['USER']}". On my deployment host I won't
> be a sudoer. For now I've simply removed the "sudo" portion of each
> command, and it seems to work. Am I inadvertently breaking something?
> Why the 'sudo'?

It's there for the people who want to run crons as the apache user,
which has no login.

>
> 3) When a rails_cron process is started, "ps" doesn't list it for me.
> "ps a" does. Should I expect simply "ps" to work (as its written in
> startup.rake) ?
>

ps works for me, on my Mac Tiger.

RailsCron is new and under active development.  So its not quite
"there" yet, but I'm working hard on it.  Feedback and especially
patches are welcome!


--
Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261
This topic is locked and can not be replied to.