1

I'm working on a Rails 3 app that includes rmagick and I'm able to start and run it successfully using WEBrick and Passenger Standalone. However, when I try running the app using Passenger within Apache, I get the following error:

dlopen(/Users/20217633/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /usr/local//lib/libjpeg.8.dylib in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO - /Users/20217633/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rmagick-2.13.1/lib/RMagick2.bundle

Is anyone familiar with this problem?

=== UPDATE ===

Below is a copy of my httpd.conf:

SetEnv PATH /usr/bin:/usr/local/bin

LoadModule passenger_module /Users/20217633/.rvm/gems/ruby-1.9.2-p0@rails3/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
LoadModule upload_progress_module modules/mod_upload_progress.so
PassengerRoot /Users/20217633/.rvm/gems/ruby-1.9.2-p0@rails3/gems/passenger-3.0.2
PassengerRuby /Users/20217633/.rvm/wrappers/ruby-1.9.2-p0@rails3/ruby

<VirtualHost *:80>
    ServerName www.domain.com
    DocumentRoot /Users/20217633/apps/github/project/public

    PassengerLogLevel 3
    RackEnv development
</VirtualHost>
Sam
  • 1,509
  • 3
  • 19
  • 28
tgg
  • 91
  • 1
  • 10

2 Answers2

0

Apache worker processes don't run as a normal user, the environment is scrubbed and won't have things like path.

I bet you're loading a different/incorrect version of ImageMagick under Passenger/Apache.

You should be able to fix this by manually setting your PATH in your passenger/apache conf:

SetEnv PATH /usr/bin:/path/to/correct/image_magick
Winfield
  • 18,985
  • 3
  • 52
  • 65
  • thanks for the suggestion @winfield - I tried adding the path as you can see in my edits above but to no avail. would you please verify that my httpd.conf matches your suggestion? _which convert_ returns */usr/local/bin/convert* – tgg Mar 01 '11 at 19:56
0

It seems that a symlink is broken, I found something in this forum

delete the symlinks "libpng.dylib" and "libjpeg.dylib" in "<installation directory>/lib/"

Create new symlinks to the right libs.

ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPNG.dylib /Applications/MAMP/Library/lib/libPNG.dylib

ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib /Applications/MAMP/Library/lib/libJPEG.dylib

I have no Mac rigth here, but first i would verify that the origin of the symlink exist, i hope this will solve your problem.

sacabuche
  • 2,781
  • 1
  • 27
  • 35