# RMagick not working

**URL:** <https://www.ruby-forum.com/t/rmagick-not-working/88432>\
**Category:** Rails\
**Created:** [March 11, 2007, 12:23am UTC](https://www.ruby-forum.com/t/rmagick-not-working/88432 "2007-03-11T00:23:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marotte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@marotte](https://www.ruby-forum.com/u/marotte)\
**Post date:** [March 11, 2007, 12:23am UTC](https://www.ruby-forum.com/t/rmagick-not-working/88432/1 "2007-03-11T00:23:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![marotte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@marotte](https://www.ruby-forum.com/u/marotte)\
**Post date:** [March 11, 2007, 7:44am UTC](https://www.ruby-forum.com/t/rmagick-not-working/88432/2 "2007-03-11T07:44:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marotte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@marotte](https://www.ruby-forum.com/u/marotte)\
**Post date:** [March 11, 2007, 12:57pm UTC](https://www.ruby-forum.com/t/rmagick-not-working/88432/3 "2007-03-11T12:57:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marotte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@marotte](https://www.ruby-forum.com/u/marotte)\
**Post date:** [March 11, 2007, 6:52pm UTC](https://www.ruby-forum.com/t/rmagick-not-working/88432/4 "2007-03-11T18:52:30Z")

</div>

Oops, actually, I put

require ‘RMagick’  
include Magick

(without the quotes) in my code, already…
