From: Emil Macarie Date: 2010-12-15T02:04:37+09:00 Subject: Re: Conflicting definitions between ActiveRecord and QT Stefano Crocco wrote in post #968233: > On Tuesday 14 December 2010 13:19:29 Emil Macarie wrote: >> I install ruby 1.9.1, ruby qtbindings, and read up some qt tutorials >> >> >> Basically there is a constants defined for Module in qtruby4.rb as >> well as introspection.rb >> How can I go about resolving such a conflict. As far as I can see >> there are no modules used, just on giant C like global namespace. Is >> there any way I can separate qt and active record by namespace ? >> >> Any suggestions for further research would be very helpful. >> >> Thanks ! > > In ruby 1.8, Module#constants takes no arguments and qt-ruby redefines > it in > the same way. However, in ruby 1.9, Module#constants takes one argument > (which > is why activesupport calls it with one), but qt-ruby doesn't take this > into > account when redefining it. I'd say this is a bug in qt-ruby and will > report > it to the developers. In the meantime, I think you can solve your issue > redefining it yourself before requiring activesupport: > > require 'activesupport' > require 'Qt4' > > class Module > > alias_method :constants_defined_by_qt, :constants > def constants inherit=true > constants_defined_by_qt > end > > end > > I hope this helps > > Stefano Thank you for your help. I will give that a shot as soon as I get back to my Ruby environment. I'll also try to see if I can get something working where constants with no arguments and constants with an argument point to different functions. -- Posted via http://www.ruby-forum.com/.