Infinite loop of 'require'

View: New views
5 Messages — Rating Filter:   Alert me  

Infinite loop of 'require'

by Kirushik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm trying to start Ruby development with Netbeans 6.5 on Kubuntu Jaunty.

JRuby version works, but I have some strange behavior with Ruby 1.8.7 installed from apt.

I create a new project, and default "Hello world" program hangs on run.

From `ps -f|grep ruby` I found that Netbeans starts Ruby with -I option for every folder in sources. So, as my newly created "new.rb" file is inside default sources folder as well, it is recursively required into itself.

So, Ruby interpreter runs into an infinite loop of file inclusions.



Can this behavior be eliminated? Netbeans seems to be quite a superb IDE.

I'm a little bit vague, I know. Every clarifying question is welcome.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Infinite loop of 'require'

by Kirushik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Ooops, duplicate post. Please, forgive my ISP






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Infinite loop of 'require'

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

The -I option is just for the load path, so I'm not sure I understand
how that would lead to an infinite loop -- can you please post some
example code here?

Thanks,
Erno

kirushik wrote:

> I'm trying to start Ruby development with Netbeans 6.5 on Kubuntu Jaunty.
>
> JRuby version works, but I have some strange behavior with Ruby 1.8.7 installed from apt.
>
> I create a new project, and default "Hello world" program hangs on run.
>
> From `ps -f|grep ruby` I found that Netbeans starts Ruby with -I option for every folder in sources. So, as my newly created "new.rb" file is inside default sources folder as well, it is recursively required into itself.
>
> So, Ruby interpreter runs into an infinite loop of file inclusions.
>
>
>
> Can this behavior be eliminated? Netbeans seems to be quite a superb IDE.
>
> I'm a little bit vague, I know. Every clarifying question is welcome.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Infinite loop of 'require'

by Kirushik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Oh, it is, I really see.

Thanks for your tip.

It comes out that I don't know why the ruby interpreter hangs.

I've intercepted full ruby commandline from ps, and pasted it into bash - the result was the same - empty output and never stopping ruby process. That's why I accused commandline arguments. There were only -I options. So my conclusion was: "-I stands for include. Perhaps, it includes every file inside of the dir. So, I do include file inside itself inside itself inside itself..."

I was totally wrong - if won't break ruby even if you explicitly require file from itself.



Whoa, man, there's some dark magic! Some of my own attempts to eliminate the problem really did the trick! Everything works.



This forum really helps, I want to thank everyone involved.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Infinite loop of 'require'

by Gives-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank You for ur topic. I think it’s a very important topic. Thank you again.



 Acai Berry  (http://productreviewsby.me/acai-berry/)






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...