开发者

Ruby Interpreter crashes with a certain word

Ok, this one's a little ridiculous, and I'm almost afraid no one will believe me. But here it goes:

I have written a Ruby Rails application that handles content for tons of domains. Now I know this bre开发者_Python百科aks the cardinal rule of Rails, but each domain has all of its information housed in a config file. I know this is probably wrong, but it is how it is setup right now, and it won't too soon (though it will). Anyway, the name of the domain you want to view is passed in as a parameter (at least in development). This parameter is used to open up the config file of the same name. This means that if I want to view the content for domain xxx, I need to enter (with a Mongrel server active) http://localhost:3000?name=xxx. Rails will refer to xxx.xml, and pull out the necessary info.

This has worked fine for all of the domains so far. It has been easy to generate config files and change them accordingly. Except, now there is a domain that, when I try to view it, crashes the Ruby Interpreter. After testing it, the only thing that causes a problem is the actual domain name, which is pumarunningshoes.com. When I changed the word puma to luma, it worked fine. When I changed it back, everything crashed again. So, I must conclude that Rails, or Mongrel, hates the word "puma". Why is this? Is it a reserved word, or function I do not know about?

Thanks for your help!


Ok, I kind of fixed it. I hate to admit this, as it is rather embarassing. However, in the spirit of SO, which is dedicated to learning, I will describe my solution.

Basically, I went line-by-line through the controller method that was called for this domain. I found out that one of my methods, which has worked for every other domain, is somehow failing on this one. When I removed the method calls and the associated view stuff, it suddenly worked.

I made an assumption that if it worked for every other domain, that it would work for this one as well. I didn't do anything different for this one. So now I have to figure out why the method fails on this one. But at least I got it working.

I appreciate all of your help. Thank you, SO community!


Actually you should be able to attach GDB to a running mongrel process and simulate the crash (since you already know it happens when domain is set to particular string 'x') pretty easily.

For more information see Gdb wrapper for ruby

Once you have the place where its crashing (or segfaulting), either update this thread with backtrace you got in gdb or mail the backtrace to ruby-core.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜