views:

258

answers:

4

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 breaks 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!

A: 

Do you get any sort of stack trace?

Jim McKerchar
Sorry... it's not an answer, but i don't yet have the rep to post comments :(
Jim McKerchar
Nope, no stack trace. A dialog pops up saying the ruby interpreter stopped. I'm currently still trying things. I found out about where in my controller it quits, but that doesn't mean anything, as it works for every other domain this applications works with.
G. Martin
A: 

check for oddities like permissions on the file and duplicate filenames/bad paths?

Lukas
There isn't a permissions problem...there's over 100 other domains that are almost exactly the same, but with different file names. That's what makes this so strange; its like rails doesn't like the text of the filename. When I changed the file name and requested the changed name in the browser it worked fine. Changing it back to have the word "puma" ruined it again. It worries me...
G. Martin
A: 

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.

Hemant Kumar
+1  A: 

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!

G. Martin