FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Infinite loop of 'require'

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
kirushik



Joined: 15 Jul 2009
Posts: 3

PostPosted: Wed Jul 15, 2009 8:36 am    Post subject: Infinite loop of 'require' Reply with quote

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.
Back to top
View user's profile Send private message
kirushik



Joined: 15 Jul 2009
Posts: 3

PostPosted: Wed Jul 15, 2009 8:37 am    Post subject: Reply with quote

Ooops, duplicate post. Please, forgive my ISP
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Wed Jul 15, 2009 8:53 am    Post subject: Infinite loop of 'require' Reply with quote

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:
Quote:
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.











Back to top
kirushik



Joined: 15 Jul 2009
Posts: 3

PostPosted: Wed Jul 15, 2009 9:14 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Gives



Joined: 06 Aug 2009
Posts: 2

PostPosted: Sat Aug 08, 2009 9:52 pm    Post subject: Reply with quote

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

Acai Berry
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB