私の Rails アプリは ImageMagick を利用していますが、アプリは ImageMagick コマンド ("identify") を実行しようとして失敗します。開発中 (Apache/Passenger を実行している場所) でこの問題を修正するには、Apache 構成で次の環境変数を渡します。
SetEnv MAGICK_HOME /opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16
SetEnv DYLD_LIBRARY_PATH /opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16/opt/local/lib
SetEnv PATH /usr/bin:/opt/local/var/macports/software/ImageMagick/6.5.9-0_0+q16/opt/local/bin
ただし、私の実稼働環境では Nginx と Mongrel (私が設定したものではありません) が実行されており、これらの変数をアプリに渡す方法がわかりません。現在、私の nginx.conf ファイルは次のとおりです。
# user and group to run as
user mouthbreather mouthbreather;
worker_processes 4;
# pid of nginx master process
pid /var/run/nginx.pid;
events {
worker_connections 8192;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/engineyard/nginx/access.log main;
error_log /var/log/engineyard/nginx/error.log notice;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/sites/*.conf;
}
だから私の質問は:
- 私のMAGICK_HOMEが本番環境のどこにあるかを確認するにはどうすればよいですか?
- これらの変数を nginx.conf 経由でアプリに渡すにはどうすればよいですか?
ありがとう!