Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

gem dependency const loading issues

#1159

I have been having major issues with resource_controller loading as a gem dependency. The problem is that when active support tries to load the gem, it comes up with a crazy constant name like this one:

Gems::ResourceController-0.5.3::Lib

It is difficult to diagnose, and regression test, since it's heavily dependent on the circumstances:

  • With the gem installed on the system, it never happens (unless rails version >= 2.1.1).
  • It never ever happens in test mode.

I have tried manually requiring all the files in resource_controller to make sure that the consts are never missing, as a workaround, but since I need ApplicationController in r_c, it seems to create a lot of conflicts.

I have narrowed the issue down to this load path being present in my Dependencies.load_paths

RAILS_ROOT/vendor

with Dependencies' logging turned on, I can see that it tries to load the const properly from:

RAILS_ROOT/vendor/gems/resource_controller-0.5.3/lib

but also from the above path:

e.g.

Dependencies: called load_file("/Users/james/Documents/railsApps/po_creator/vendor/gems/resource_controller-0.5.3/lib/urligence.rb", ["Urligence", "Gems::ResourceController-0.5.3::Lib::Urligence"])

If I delete RAILS_ROOT/vendor from the load_paths, everything works fine, but I'm not sure whether that path is necessary, so I don't want to ship a version of r_c that deletes it.

It is there in test mode, but doesn't seem to cause the problem. Anybody have any ideas?

Reported by James · October 2nd, 2008 @ 10:14 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Matt Jones
    Matt Jones

    This got fixed in this commit and in a corresponding one in 2-2-stable.

    Let me know if it still give you problems on 2.2.

    November 25th, 2008 @ 03:39 AM

  2. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to resolved

    March 7th, 2009 @ 02:45 PM