Skip to content
This repository has been archived by the owner on Mar 24, 2018. It is now read-only.

Multi Require causes exception #5

Open
samhendley opened this issue May 20, 2010 · 4 comments
Open

Multi Require causes exception #5

samhendley opened this issue May 20, 2010 · 4 comments

Comments

@samhendley
Copy link

Hi Macks, I mentioned an issue in my pull request. This error has been present for a while but is really pronounced in the eval() done to verify that the file created is able to be loaded. Basically the protobuf classes are not tolerant of being re-required.

http://gist.github.com/407742

What I think it should do is probably throw away the old definition if it is re-required but I wanted to get your opinion and input on the cleanest way to do that rather than go in with a machete myself.

@skrat
Copy link

skrat commented Nov 10, 2010

Hi Macks, I do suffer the same problem. I'm using it in Rails 3, and there is loads of require magic going on, everything works fine, but deployed application is raising TagCollisionError. I tried locally to re-require my protobuf models, and indeed they are raising this exception.

@yanks
Copy link

yanks commented Feb 24, 2011

I am also having this problem. Using Rails3/Ruby 1.8.7 when classes are not cached it appears it re-requires the pb.rb which causes a collision:

/Library/Ruby/Gems/1.8/gems/ruby_protobuf-0.4.9/lib/protobuf/message/message.rb:43:in `define_field': Field tag 1 has already been used in NameSpace::Object. (Protobuf::TagCollisionError)

@vivrass
Copy link

vivrass commented Sep 20, 2011

I've tried to fix this bug with that commit : vivrass@862aed1

After trying my fix, I saw that was not the problem in my application so I cannot confirm that it is working. You can try it to verify if you want.

@AndydeCleyre
Copy link

Has anyone tried @vivrass's suggested fix?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants