rails 2.2.2 and r_c gem: already initialized constant warnings

20 views
Skip to first unread message

David Lowenfels

unread,
Feb 10, 2009, 7:24:05 PM2/10/09
to resource_controller
I just upgraded from rails 2.1.2 to 2.2.2
I had r_c installed as a plugin, now I'm using it as a gem:
config.gem 'giraffesoft-resource_controller', :lib =>
'resource_controller', :source => 'http://gems.github.com'

I get these warnings when I run my tests:

/sw/lib/ruby/gems/1.8/gems/giraffesoft-resource_controller-0.5.5/lib/
resource_controller.rb:4: warning: already initialized constant
ACTIONS
/sw/lib/ruby/gems/1.8/gems/giraffesoft-resource_controller-0.5.5/lib/
resource_controller.rb:5: warning: already initialized constant
SINGLETON_ACTIONS
/sw/lib/ruby/gems/1.8/gems/giraffesoft-resource_controller-0.5.5/lib/
resource_controller.rb:6: warning: already initialized constant
FAILABLE_ACTIONS
/sw/lib/ruby/gems/1.8/gems/giraffesoft-resource_controller-0.5.5/lib/
resource_controller.rb:7: warning: already initialized constant
NAME_ACCESSORS

Please advise.
Thanks,
David

James Golick

unread,
Feb 10, 2009, 7:26:17 PM2/10/09
to resource_...@googlegroups.com
Must be related to some kind of double loading. Are you requiring 'test_helper' in your tests or are you requiring File.dirname(__FILE__) + '/test_helper' ?

The latter causes problems with double loading of stuff.

-J.

David Lowenfels

unread,
Feb 11, 2009, 4:18:46 PM2/11/09
to resource_controller
Hi James,
Thanks for the tip. Actually it still doesn't fix my problem..

-D

James Golick

unread,
Feb 11, 2009, 4:20:07 PM2/11/09
to resource_...@googlegroups.com
ok - I'll have to add unless defined? to all those consts. it's on my list.

-J.
Reply all
Reply to author
Forward
0 new messages