RailsCron: error message


#1

Hi,

I’m trying to use RailsCron but keeping getting an error when I try to
run
it. I’m a beginner, so please use small words :slight_smile:

-bash-2.05b$ rake cron_start
(in /home/jake/rails_sites/testsite)
Syntax error: “&” unexpected

The little bit I know about my environment:

  • RailsCron installed as a plug in (not gem, cause I’m on a shared host)
  • Debian Linux
  • rake cron_status returns nothing
  • in cron_start, the symbol &> is in the script, but I have no idea how
    to
    find out what the symbol means (google doesn’t search symbols well). I
    believe this & is what it’s choking on, but I don’t know how to confirm.

I’ve tried running “ruby script/runner ‘RailsCron.start’&”, but my test
method doesn’t seem to execute. The database does seem to get populated
with cron jobs though.

How should I go about debugging this? It seems a bit complicated.

Any help would be appreciated.

Thanks,
Jake


#2

This still happens - there is a line in the rake tasks file:

puts #{sudo "nohup ruby script/runner -e #{mode} \"RailsCron.start \" &> /dev/null &"}

Perhaps the & before > was intended to be 2 (to redirect stderr to null)

puts #{sudo "nohup ruby script/runner -e #{mode} \"RailsCron.start \" 2> /dev/null &"}


#3

puts #{sudo "nohup ruby script/runner -e #{mode} \"RailsCron.start \" &> /dev/null &"}

Try:

puts `#{sudo "nohup ruby script/runner -e #{mode} “RailsCron.start”

/dev/null 2>&1 &"}`

It’s supposed to send both stdout and stderr to dev/null.

-Kyle


#4

On 2/19/06, Van Vo removed_email_address@domain.invalid wrote:

  • RailsCron installed as a plug in (not gem, cause I’m on a shared host)
    How should I go about debugging this? It seems a bit complicated.

Any help would be appreciated.

Thanks,
Jake


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

Are you running from the trunk? If not, can you move to trunk and see
if the error is still there?


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261


#5

Kyle M. <kyle@…> writes:

puts #{sudo "nohup ruby script/runner -e #{mode} \"RailsCron.start \" &> /dev/null &"}

Try:

puts `#{sudo "nohup ruby script/runner -e #{mode} “RailsCron.start”

/dev/null 2>&1 &"}`

It’s supposed to send both stdout and stderr to dev/null.


The error no longer appears for me.

Thanks,
Jake


#6

On 2/22/06, Jake removed_email_address@domain.invalid wrote:


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

Great, I’ll modify it in the trunk then…


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261