# Require rmagick

**URL:** <https://www.ruby-forum.com/t/require-rmagick/53031>\
**Category:** Rails\
**Created:** [January 23, 2006, 3:53pm UTC](https://www.ruby-forum.com/t/require-rmagick/53031 "2006-01-23T15:53:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tachekent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7993a0/32.png) [@tachekent](https://www.ruby-forum.com/u/tachekent)\
**Post date:** [January 23, 2006, 3:53pm UTC](https://www.ruby-forum.com/t/require-rmagick/53031/1 "2006-01-23T15:53:19Z")

</div>

Hello,  
I’m trying to use rmagick in a helper script (for auto-generating image  
sizes) and I’m not sure where I should be calling ‘require’.

currently I have:  
require ‘RMagick’ at the top of my controller:

```
class FilmsController < ApplicationController
  require 'RMagick'

```

but that’s giving me an error:

```
uninitialized constant ImageList

```

…whenever I try and do anything. From what I’ve read it seems that  
this probably a failure to require.

Looking for RMagick in my system I find:

/usr/lib/ruby/gems/1.8/gems/rmagick-1.9.3/lib/RMagick.rb  
/usr/local/lib/site\_ruby/1.8/RMagick.rb

but do I need to specify where rails should be looking for these files?

dorian

## – I do things for love or money

## +44 (0)7941 219 501

aim:oulalipo | yahoo:tachekent

---

<div class="post-metadata">

**Author:** ![tachekent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7993a0/32.png) [@tachekent](https://www.ruby-forum.com/u/tachekent)\
**Post date:** [January 23, 2006, 4:25pm UTC](https://www.ruby-forum.com/t/require-rmagick/53031/2 "2006-01-23T16:25:36Z")

</div>

Pull up IRB and try your require ‘RMagick’ there, see if it is installed  
correctly and if ruby knows where to find it. Don’t worry if you get  
“false” returned, as long as it doesn’t spit up a bunch of errors.

C:\Code\Work\db\migrate|â?º irb  
irb(main):001:0\> require ‘RMagick’  
=\> false  
irb(main):002:0\> require ‘rgick’  
LoadError: No such file to load – rgick  
from  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:18:in  
`require__' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in`require’  
from (irb):2  
irb(main):003:0\>

As for where to call it, so that it is included in your app I’m not  
sure. I  
do believe \>= 1.0 you want to use config/boot.rb. Before 1.0 I used  
config/environment. However I’m not sure if that is the way to go.

-B

---

<div class="post-metadata">

**Author:** ![tachekent](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7993a0/32.png) [@tachekent](https://www.ruby-forum.com/u/tachekent)\
**Post date:** [January 23, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/require-rmagick/53031/3 "2006-01-23T22:37:10Z")

</div>

On Jan 23, 2006, at 6:51 AM, Dorian M. wrote:

> but that’s giving me an error:
> 
> uninitialized constant ImageList
> 
> …whenever I try and do anything. From what I’ve read it seems  
> that this probably a failure to require.
> 
> Looking for RMagick in my system I find:
> 
> /usr/lib/ruby/gems/1.8/gems/rmagick-1.9.3/lib/RMagick.rb  
> /usr/local/lib/site\_ruby/1.8/RMagick.rb

RMagick is a shared library, not a ruby script:

$ locate RMagick  
/usr/local/lib/ruby/site\_ruby/1.8/RMagick.rb  
/usr/local/lib/ruby/site\_ruby/1.8/i386-freebsd5/RMagick.so

You don’t have RMagick installed correctly.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
