Rails Tip #47

Posted by Eric Stewart Fri, 02 Dec 2005 01:43:00 GMT

You have set up your shiny new Rails application, written some code and are ready to play. You fire up script/server and point your browser to http://localhost:3000 and all is well. Now time to put it on a real server and let the hordes have at it!

You choose your webserver of choice, configure it, and choose the appropriate dispatch.x script to launch it. But when you point your web browser at the new web server you get some useless error or blank page.

Luckily checking the web server logs shows that the code loading Rails isn’t happy. Not happy at ALL! But, it’s some crazy error in code_generation.rb:68 that everyone was talking about a month ago. You are running the latest Ruby 1.8.3 however, not an older version of 1.8.2. What gives? ! ? !

Trying to run the dispatch scripts directly is worse. All you get is a dry Status: 500 Internal Server Error and no log messages. A lot of help that is!

Somehow you trudge along and remember that you changed the shebang lines your dispatch scripts to point to #!/usr/bin/env ruby like a good little unix scripter, because that’s the proper thing to do in most cases. Apparently not in this one.

You change the shebang line to reference your specific version of Ruby and try again. All is well. What’s a few lost hours of frustration?

Next time, check the least intuitive thing first!

Comments

(leave url/email »)

   Comment Markup Help Preview comment