skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

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.

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

PorstiluxwiresKeri JohnsrudMichelleConcerttributeherekittyapartment story (color)

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.


2 Comments

Posted by
Cristian znexus
21 October 2008 @ 3pm

I also notice these bizarre errors (stack full, spected user and geted user) and, thanks to you, I proceed like you:

I just remove engines plugin, and move “restful_comments/apps” contents to root/apps. I also move assets(javascript and styles) to public folder and add to “routes.rb” the map.resource :comments line

Now thats’fine

Cristian


Posted by
Sebastien Grosjean - ZenCocoon
3 February 2009 @ 3pm

Hi Yan,

Thanks a lot for your tips, I had the dependency system issue and your tips just solved it, saving me good bunch of time.

Thanks a lot for sharing,
Warm regards,


Leave a Comment

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