# Rb\_load\_file crashes when there no bracket is provided

**URL:** <https://www.ruby-forum.com/t/rb-load-file-crashes-when-there-no-bracket-is-provided/109532>\
**Category:** Ruby\
**Created:** [July 16, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/rb-load-file-crashes-when-there-no-bracket-is-provided/109532 "2007-07-16T15:20:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saravanan77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@saravanan77](https://www.ruby-forum.com/u/saravanan77)\
**Post date:** [July 16, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/rb-load-file-crashes-when-there-no-bracket-is-provided/109532/1 "2007-07-16T15:20:17Z")

</div>

Hi,

When i tried to load the below mentioned code using rb\_load\_file it  
works

def Category(pArg1)  
lvalue = (""" + “CatA” + “”" + pArg1)  
eval “#{lvalue}”  
end

def is(pArg1)  
return “==”" + pArg1 + “”"  
end

i = Category(is(‘CatB’))

But when i changed the line  
i = Category(is(‘CatB’)) to  
i = Category is ‘CatB’ #removing the brackets  
rb\_load\_file crashes. btw i am using borland c++ 6.0

How to solve this problem?

Thanx in advance.

Cheers,  
Saravanan A

---

<div class="post-metadata">

**Author:** ![saravanan77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@saravanan77](https://www.ruby-forum.com/u/saravanan77)\
**Post date:** [July 16, 2007, 4:02pm UTC](https://www.ruby-forum.com/t/rb-load-file-crashes-when-there-no-bracket-is-provided/109532/2 "2007-07-16T16:02:24Z")

</div>

> But when i changed the line  
> i = Category(is(‘CatB’)) to  
> i = Category is ‘CatB’ #removing the brackets

Why do you need to remove brackets?

---

<div class="post-metadata">

**Author:** ![saravanan77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@saravanan77](https://www.ruby-forum.com/u/saravanan77)\
**Post date:** [July 16, 2007, 4:11pm UTC](https://www.ruby-forum.com/t/rb-load-file-crashes-when-there-no-bracket-is-provided/109532/3 "2007-07-16T16:11:57Z")

</div>

Phil M. wrote:

> > But when i changed the line  
> > i = Category(is(‘CatB’)) to  
> > i = Category is ‘CatB’ #removing the brackets
> 
> Why do you need to remove brackets?

This is basically a set of rules that our client will define. I am  
writing DSL so that it will be easy for our client. When i execute the  
same using ruby.exe it works but with bracket warning. I think  
rb\_load\_file is crashing because of this warning message.

Please help me

Regards,  
Saravanan A

---

<div class="post-metadata">

**Author:** ![saravanan77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@saravanan77](https://www.ruby-forum.com/u/saravanan77)\
**Post date:** [July 16, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/rb-load-file-crashes-when-there-no-bracket-is-provided/109532/4 "2007-07-16T16:59:10Z")

</div>

when rb\_gv\_set(“VERBOSE”, Qnil)is executed, it works fine. Basically  
this will suppress all the warnings. This is equivalent to “ruby -w”

Saravanan Sar wrote:

> Phil M. wrote:
> 
> > > But when i changed the line  
> > > i = Category(is(‘CatB’)) to  
> > > i = Category is ‘CatB’ #removing the brackets
> > 
> > Why do you need to remove brackets?
> 
> This is basically a set of rules that our client will define. I am  
> writing DSL so that it will be easy for our client. When i execute the  
> same using ruby.exe it works but with bracket warning. I think  
> rb\_load\_file is crashing because of this warning message.
> 
> Please help me
> 
> Regards,  
> Saravanan A
