使用 rmagick 的 Rails 3 应用程序开始使用独立乘客,但通过 apache 使用乘客失败
我正在开发一个包含 rmagick 的 Rails 3 应用程序,我能够使用 WEBrick 和 Passenger Standalone 成功启动和运行它。但是,当我尝试在 Apache 中使用 Passenger 运行应用程序时,出现以下错误:
dlopen(/Users/20217633/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): 找不到符号:__cg_jpeg_resync_to_restart 引用自: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO 预期位于:/usr/local//lib/libjpeg.8.dylib 中 /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
有人熟悉这个问题吗?
=== 更新===
下面是我的 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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Apache工作进程不以普通用户身份运行,环境被清理并且不会有路径之类的东西。
我敢打赌您正在 Passenger/Apache 下加载不同/不正确版本的 ImageMagick。
您应该能够通过在乘客/apache 配置中手动设置 PATH 来解决此问题:
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:
似乎符号链接已损坏,我在 this 中找到了一些内容论坛
删除
“<安装目录>/lib/”中的符号链接“libpng.dylib”和“libjpeg.dylib”
创建指向正确库的新符号链接。
我这里没有 Mac 设备,但首先我会验证符号链接的来源是否存在,我希望这能解决您的问题。
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.
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.