# Crontab.rb:117: warning: tried to create Proc object without

**URL:** <https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067>\
**Category:** Ruby\
**Created:** [August 3, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067 "2006-08-03T12:09:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067/1 "2006-08-03T12:09:33Z")

</div>

with crontab.rb:117:

i get a warning: tried to create Proc object without a block

line 117 being :  
job = proc if iterator?

what could I change to avoid this warning ???

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 12:28pm UTC](https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067/2 "2006-08-03T12:28:59Z")

</div>

On 02/08/06, Une bÃ©vue [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> with crontab.rb:117:
> 
> i get a warning: tried to create Proc object without a block
> 
> line 117 being :  
> job = proc if iterator?
> 
> what could I change to avoid this warning ???

Don’t use proc as a variable name.

Paul.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 12:30pm UTC](https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067/3 "2006-08-03T12:30:47Z")

</div>

On 8/2/06, Une bÃ©vue [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> une bÃ©vue

Do you want the proc object of the given block?  
In that case I know only one method

def whatever(\*args, &blk)  
job = blk if blk  
# Do something with job  
end

## Hope that helps Robert

Deux choses sont infinies : l’univers et la bÃªtise humaine ; en ce qui  
concerne l’univers, je n’en ai pas acquis la certitude absolue.

- Albert Einstein

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 12:31pm UTC](https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067/4 "2006-08-03T12:31:00Z")

</div>

Le 2 aoÃ»t 06 Ã 14:05, Paul B. a Ã©crit :

> Don’t use proc as a variable name.

the file i’ve found “crontab.rb” is of 2001, may be that’s the reason…

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 12:32pm UTC](https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067/5 "2006-08-03T12:32:35Z")

</div>

ts [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> svg%
> 
> svg% ./ruby -ve ‘def a() j = Proc.new if iterator?; p j end; a {}’  
> ruby 1.8.0 (2003-08-04) [i686-linux]  
> #Proc:0xb7def2a4@-e:1  
> svg%

fine, thanks !

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 12:31pm UTC](https://www.ruby-forum.com/t/crontab-rb-warning-tried-to-create-proc-object-without/101067/6 "2006-08-03T12:31:38Z")

</div>

> > > > > “Y” == Yvon T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

Y\> the file i’ve found “crontab.rb” is of 2001, may be that’s the  
reason…=

yes,

svg% ./ruby -ve ‘def a() j = proc if iterator?; p j end; a {}’  
ruby 1.6.8 (2002-12-24) [i686-linux]  
#Proc:0xb7cb293c  
svg%

svg% ./ruby -ve ‘def a() j = proc if iterator?; p j end; a {}’  
ruby 1.8.0 (2003-08-04) [i686-linux]  
-e:1: warning: tried to create Proc object without a block  
#Proc:0xb7d542b8@-e:1  
svg%

svg% ./ruby -ve ‘def a() j = Proc.new if iterator?; p j end; a {}’  
ruby 1.8.0 (2003-08-04) [i686-linux]  
#Proc:0xb7def2a4@-e:1  
svg%

Guy Decoux
