2015-06-25 01:21:35.0|分类: nginx|浏览量: 1881
首先通过gem安装passenger gem install passenger 因为Nginx不支持动态module载入,所以需要通过Passenger来自动下载,编译,安装由Passenger修改版的Nginx: passenger-install-nginx-module Yes: download, compile and install Nginx for me. (recommended) No: I want to customize my Nginx installation. (for advanced users) Whichever you choose, if you already have an existing Nginx configuration file, Enter your choice (1 or 2) or press Ctrl-C to abort: 这里建议选择1 因为它会自动下载ngnix。 Please specify a prefix directory [/opt/nginx]: /usr/local/nginx(自己设置路径,默认的路径是/opt/nginx) Passenger会自动帮你将下面两行添加到Nginx的配置文件中/opt/nginx/conf/nginx.conf(很人性化) http { ... passenger_root /Users/Daniel/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.10; passenger_ruby /Users/Daniel/.rvm/wrappers/ruby-1.9.2-p290/ruby; ... } 请不要忘记将nginx命令行程序连接到/usr/sbin sudo ln -s /ope/nginx/sbin/nginx /usr/sbin/ |