Install passenger
1
Gem Install passenger
Install Ngnix
1
Passenger-install-nginx-module
Nginx and passenger are already installed, default configuration and commands
1
#配置
2
/opt/nginx/conf/nginx.conf
3
Command
4
/opt/nginx/sbin/nginx
Modify the default file
1
HTTP {
2
passenger_root/library/ruby/gems/1.8/gems/passenger-4.0.5;
3
Passenger_ruby/system/library/frameworks/ruby.framework/versions/1.8/usr/bin/ruby;
4
Rack_env gabriellocal;
Prepare Rails project, view Phusion
Configuring the server, configuring templates
1
server {
2
Listen 80;
3
Passenger_ruby/users/soft/.rvm/wrappers/ruby-1.9.3-p429@rails3/ruby;
4
server_name localhost;
5
Root/users/soft/sites/rails-unity/public; # <---Be sure to the ' public '!
6
Passenger_enabled on;
7
}
You need to configure the following
Passenger_ruby Use the correct ruby version
server_name owns the domain name
Listen-Listening ports
The public directory of the root Rails program
The latter items are fine, the first one is obtained by following
1
#切换到正确的rails版本
2
RVM Use 1.9.3@RAILS3
3
#安装passenger, there's no such command.
4
Gem Install passenger
5
Passenger-config--ruby-command
6
#在输出结果中找出 Passenger_ruby,
Reboot Nginx, complete