2013年8月22日 星期四

[RoR] Nginx + Passenger on OSX

先安裝Passenger

gem install passenger

在安裝Nginx

passenger-install-nginx-module


這樣就安裝好了

不過配置的部份可能是裝的版本比較新跟網路上其他的人有些不一樣

使用vim編輯 nginx.conf
vim /usr/local/nginx/conf/nginx.conf
 
在server{}中加入 rails_env development
在location / {}中設定root到專案的public資料夾
然後加入passenger_enabled on
 
這樣基本設定就結束了
 
使用sudo nginx -t測試
使用sudo nginx運行
使用sudo nginx -s reload重讀配置
使用sudo nginx -s stop停止 
 

沒有留言: