Color is not a module /usr/lib/ruby/gems/1.8/gems/color-1.4.0/lib/color.rb:19 Gems installed in application: pdf-writer 1.1.8 + color 1.4.0 + color-tools 1.3.0 can happen to any pdf-writer version and in any OS (tested on XP/ Ubuntu/Debian/FreeBSD) I have two models: require ''pdf/writer'' require ''pdf/writer/graphics'' require ''pdf/simpletable'' class ModelA < ActiveRecord::Base end In this model i generate pdf''s. AND: require ''RMagick'' include Magick require ''rvg/rvg'' class ModelB < ActiveRecord::Base end And in this model i generate images''s. Problem are raised when i added ModelB rmagick support. I was unable to use pdf generator(ModelA) as well as ModelB. After some research i found that if i remove requires from ONE OF model, other model is working well .... Temporary i removed ModelB requirements (generating images from another place). Looking for solution ..
On Nov 4, 9:33 am, "alexey.Creopolis" <alex.creopo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> require ''RMagick'' > include Magick > require ''rvg/rvg'' > class ModelB < ActiveRecord::Base > end > And in this model i generate images''s. > > Problem are raised when i added ModelB rmagick support. > I was unable to use pdf generator(ModelA) as well as ModelB. > > After some research i found that if i remove requires from ONE OF > model, other model is working well .... >Does removing include Magick (or moving it inside the ModelB class help) (obviously you may then need to say Magick::Blah rather than Blah for some things) ? Fred> Temporary i removed ModelB requirements (generating images from > another place). > Looking for solution ..
Yes i''ve tried it - if i remove Magick requirement then pdf model working, and vice versa. Problem that Magick having its Color class Magick::Color that is override on module Color (color gem) So current my solution is to generate image elsewhere.. On Nov 4, 11:38 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 4, 9:33 am, "alexey.Creopolis" <alex.creopo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote:> require ''RMagick'' > > include Magick > > require ''rvg/rvg'' > > class ModelB < ActiveRecord::Base > > end > > And in this model i generate images''s. > > > Problem are raised when i added ModelB rmagick support. > > I was unable to use pdf generator(ModelA) as well as ModelB. > > > After some research i found that if i remove requires from ONE OF > > model, other model is working well .... > > Does removing include Magick (or moving it inside the ModelB class > help) (obviously you may then need to say Magick::Blah rather than > Blah for some things) ? > > Fred > > > Temporary i removed ModelB requirements (generating images from > > another place). > > Looking for solution ..
On Nov 4, 1:40 pm, "alexey.Creopolis" <alex.creopo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yes i''ve tried it - if i remove Magick requirement then pdf model > working, and vice versa. > Problem that Magick having its Color class Magick::Color that is > override on module Color (color gem) > > So current my solution is to generate image elsewhere..Just don''t import Magick into the toplevel namespace and you''ll be ok. Fred> > On Nov 4, 11:38 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > On Nov 4, 9:33 am, "alexey.Creopolis" <alex.creopo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote:> require ''RMagick'' > > > include Magick > > > require ''rvg/rvg'' > > > class ModelB < ActiveRecord::Base > > > end > > > And in this model i generate images''s. > > > > Problem are raised when i added ModelB rmagick support. > > > I was unable to use pdf generator(ModelA) as well as ModelB. > > > > After some research i found that if i remove requires from ONE OF > > > model, other model is working well .... > > > Does removing include Magick (or moving it inside the ModelB class > > help) (obviously you may then need to say Magick::Blah rather than > > Blah for some things) ? > > > Fred > > > > Temporary i removed ModelB requirements (generating images from > > > another place). > > > Looking for solution ..