skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

hello, i'm yan

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Get updates by email
Follow me on twitter

Top Posts

planypus

I'm the founder of Planypus, the place to share your plans!

cohesiveft

Accessible, manageable, virtualized application stacks ready to download or deploy to the cloud!

flickr

at the paradeat the parade@slava626@leorazellman and @smazo at bat17my poor ricohyou're wearing my sweaterthe graduatethe answer, my friend

Archives

Contact

Reach me at yan at pritzker.ws

Posted
27 February 2008 @ 9pm

Tagged
thoughts

Rails 2.0 dependency system problems

This is one of those “PC Load Letter!?!?!” bugs that had be me stumped for longer than it should have. I was using the restful_comments plugin and noticed after upgrading to Rails 2 that I could only post one comment, after which point the system would start dying with bizarre errors such as “User expected, got User”.

I was also getting messages relating to “A copy of AuthenticatedSystem has been removed from the module tree but is still active”. Both of these issues (which sound a little too PC-Load-Letterish for me to believe DHH and friends weren’t watching Office Space when they created these error messages) - are basically a result of the wacky new Rails dependency system.

Fix #1: the simplest solution to the model loading problem I could come up with was to move the comment.rb model from my comment plugin into my application. There seems to be an issue with model reloading with models coming from plugins- the dependency system seems to get confused.

Fix #2: If you are getting the removed from module tree issue, it has to do with the dependency system having a problem with your libs being reloaded. I didn’t dig deep enough to understand exactly the bug in the dependency system, but it has something to do with libs not properly being reloaded. Add this to your environment.rb:


config.load_once_paths += %W( #{RAILS_ROOT}/lib )

Resources

I didn’t dig deep into the dependency system to understand the source of these issues, but for those brave enough to try, here are some resources and rails tickets toget you started.


No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment

Yahoo search broken for ‘planypus’ It’s Icy Outside