Joel's Blog

I have no idea what im doing

2/08/2007

 

rails is one big leaky abstraction....

So I have been playing with rails lately trying to develop an application and trying to learn ruby and rails(more on this later). So I have my app working pretty good last night and I check everything into subversion and then go to bed. Tongight I get the kids to bed and think I can get a few things done and I fire up locomotive and mysql and go to my login page and I get a 500 error. So I look in the development.log file and I see: Expected /Users/joelnylund/locomotive/joel/joel/config/../app/controllers/account_controller.rb to define AccountController /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:250:in `load_missing_constant' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:453:in `const_missing' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:465:in `const_missing' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/inflector.rb:251:in `constantize' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/core_ext/string/inflections.rb:148:in `constantize' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/routing.rb:1258:in `recognize' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/dispatcher.rb:40:in `dispatch' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in `process' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/1.8/sync.rb:229:in `synchronize' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in `process' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in `process_client' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in `process_client' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in `run' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in `run' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in `run' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in `run' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in `run' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in `run' /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 /Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/bin/mongrel_rails:18 Pardon my french, but what the f**k is this supposed to mean? Thank god for google, I google some variations of this error message and I finally find this posting: http://www.forbiddenweb.org/topic/140110/index.html and it says add the following lines to your environment.rb file and restart your server: module Engines CONFIG = {:edge => true} end The funny thing is no one in the post seems to know why, but they all say it fixes the problem. So I add it thinking why not... and surprise, it fixed my problem and now my application is working again. So what happened that yesterday my rails program was working fine, and today its not working any more. Now I have these 3 lines of code in my environment.rb file and it works great again. Hmmm. I have to admit im still learning rails but the typeless language coupled with the code generation and frameworks and lack of a descent debugger is about to make my head spin off. I remember similar feelings when I was first learning java 10 years ago, so I am going to give it some time before casting final judgment. If you read this and can explain please send me email and I will post an update....

Comments: Post a Comment

<< Home

Archives

This page is powered by Blogger. Isn't yours?