This project is archived and is in readonly mode.

#1159 ✓resolved
James

gem dependency const loading issues

Reported by James | October 2nd, 2008 @ 10:14 PM | in 2.x

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?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages