Hello,
On Windows XP, I got a ruby program using RMagick and working perfectly.
I put this at the begining of my code:
require ''rubygems''
require ''RMagick''
include ''Magick''
Now, when I use the exact same code within Rails, I can''t have RMagick
working... It seems it''s not initalizing. The include
''Magick'' returns
"undefined method `include''" Without the include, I got a
"dynamic
constant assignment" when I use an Image or ImageList.
I tried also to remove require''rubygems'' which I think should
not be
necessary in Rails.
I know there''s been tons of post regarding RMagick installation before,
but what puzzles me is it seems to be correctly installed... For
instance, it does appear when doing a gem list...
Any idea?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
In my app, I simply have require ''RMagick'' I create new objects like so: Magick::Image.new I think preceding Image.new is necessary because the class that I am calling from is named "Image" anyway? I''m not sure. Anyway, that works for me. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m not sure why it''d be giving you the "undefined method ''include''" but the proper include is: include Magick without the quotes. It''s not including a file but in fact telling Rails to mixin the methods of the module Magick [in the RMagick library]. I''d recommend mixing these methods in only in whatever specific class you plan on implementing RMagick in. Also, I tried out the quotes around Magick in the include and got a different error than the one you''re talking about. I got "wrong argument type String (expected Module) (TypeError)", which makes sense because of the reason I said above. Hope all that helped. RSL On 3/10/07, Emmanuel Marotte <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hello, > > On Windows XP, I got a ruby program using RMagick and working perfectly. > I put this at the begining of my code: > > require ''rubygems'' > require ''RMagick'' > include ''Magick'' > > Now, when I use the exact same code within Rails, I can''t have RMagick > working... It seems it''s not initalizing. The include ''Magick'' returns > "undefined method `include''" Without the include, I got a "dynamic > constant assignment" when I use an Image or ImageList. > > I tried also to remove require''rubygems'' which I think should not be > necessary in Rails. > > I know there''s been tons of post regarding RMagick installation before, > but what puzzles me is it seems to be correctly installed... For > instance, it does appear when doing a gem list... > > Any idea? > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Oops, actually, I put require ''RMagick'' include Magick (without the quotes) in my code, already... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---