# RMagick, ImageMagick, Passenger and Dreamhost

**URL:** <https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422>\
**Category:** Rails\
**Created:** [May 7, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422 "2009-05-07T18:05:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [May 7, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/1 "2009-05-07T18:05:27Z")

</div>

I need to use the newest version of RMagick, so i did everything as  
they say on this wiki: [http://wiki.dreamhost.com/index.php/RMagick](http://wiki.dreamhost.com/index.php/RMagick)

But, my Rails app isn’t working, here is the error:

This installation of RMagick was configured with ImageMagick 6.5.1 but  
ImageMagick 6.0.6 is in use.

I tried to set the environment variable: LD\_LIBRARY\_PATH… but no  
success…  
I’ve read a lot of people with the same problem, but i couldn’t find  
the solution.  
I guess the problem is to set a environment variable in passenger.  
Does anybody can help me?

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [May 7, 2009, 9:26pm UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/2 "2009-05-07T21:26:44Z")

</div>

It looks like you need to check the following:

1. Did you install your own version of ImageMagick in your local  
directory? Both of the following two Unix commands should give the  
same response. NOTE: YOUR\_HOME should be the path to your home  
directory. i.e.: I see /Users/rick/local/bin/Magick-config on my  
system.

$ ls ~/local/bin/Magick-config  
YOUR\_HOME/local/bin/Magick-config  
$ which Magick-config  
YOUR\_HOME/local/bin/Magick-config  
$

If the first command fails, you need to re-install ImageMagick paying  
attention to the instructions for setting “–prefix=” in the  
configuration step. After the re-install of ImageMagick you’ll need  
to reinstall RMagick.

If the first command succeeds but the second fails, you need to add  
the RMagick export settings to your shell’s runtime command file.

Shell RC File  
bash ~/.profile or ~/.bashrc  
csh ~/.login or ~/.cshrc  
tcsh ~/.login or ~/.tcshrc  
ksh ~/.profile or ~/.kshrc  
sh ~/.profile

Edit your RC file and add the following lines:

$ export PATH=$HOME/local/bin:$PATH  
$ export LDFLAGS=-L/$HOME/local/lib  
$ export CPPFLAGS=-I/$HOME/local/include  
$ export LD\_RUN\_PATH=$HOME/local/lib

Log out and back in and retry the “ls ~/local/bin/Magick-config” and  
“which Magick-config”. The results of both commands should now be  
identical. If you check the file (more ~/local/bin/Magick-config) you  
should see the prefix, exec\_prefix, libdir, and included\_dir as  
pointing at your home directory. RMagick should work now.

---

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [May 8, 2009, 5:58am UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/3 "2009-05-08T05:58:12Z")

</div>

Hey Rick,  
Thanks for answer…  
Yes i did compile my own ImageMagick and installed RMagick.  
Everything is like you said. But still no success…

Same error message: This installation of RMagick was configured with  
ImageMagick 6.5.1 but ImageMagick 6.0.6 is in use.

I think it’s not possible to set or pass environment variables to  
passenger, apache…

I’m trying this for almost a week…  
Please help me… if somebody uses Dreamhost or any similar shared  
hosting and did this please tell me how…

So far… thanks for the help.  
Daniel

---

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [May 8, 2009, 6:27am UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/4 "2009-05-08T06:27:26Z")

</div>

And also,  
If i do this:

ruby -r RMagick -e"puts Magick::Long\_version"

It shows the old version of ImageMagick

And if i set config.cache\_classes to false on my environments/  
production.rb everithing works fine…  
but slowly…

May be the solution is to reset this cache\_classes?

Thanks everybody.  
Daniel

---

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [May 9, 2009, 1:58pm UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/5 "2009-05-09T13:58:28Z")

</div>

Nobody??? Please…

---

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [May 9, 2009, 9:50pm UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/6 "2009-05-09T21:50:03Z")

</div>

I don’t have root access. It’s a shared host. that’s the main  
problem…

---

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [May 9, 2009, 4:17pm UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/7 "2009-05-09T16:17:12Z")

</div>

did you perform ldconfig?

did you try to find out where rmagick libs are?

you can try to remove /usr/local/ruby/gem/1.8/cache/rmagick-\*.gem

(u have to correct the path)

tom

Daniel2Surf wrote:

> > And if i set config.cache\_classes to false on my environments/
> > 
> > > Hey Rick,  
> > > So far… thanks for the help.
> > > 
> > > > $ which Magick-config  
> > > > csh ~/.login or ~/.cshrc  
> > > > identical. If you check the file (more ~/local/bin/Magick-config) you
> > > > 
> > > > > I’ve read a lot of people with the same problem, but i couldn’t find  
> > > > > the solution.  
> > > > > I guess the problem is to set a environment variable in passenger.  
> > > > > Does anybody can help me?  
> > > > > Thanks a lot.

# –

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

# [www.meinlschmidt.com](http://www.meinlschmidt.com) www.maxwellrender.cz www.lightgems.cz

---

<div class="post-metadata">

**Author:** ![Daniel2Surf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Daniel2Surf](https://www.ruby-forum.com/u/Daniel2Surf)\
**Post date:** [March 31, 2010, 10:05pm UTC](https://www.ruby-forum.com/t/rmagick-imagemagick-passenger-and-dreamhost/167422/8 "2010-03-31T22:05:14Z")

</div>

I had the same problem on Ubuntu, and

$sudo apt-get install librmagick-ruby1.8

did the trick for me. Hope this helps anybody.
