Install — Phusion Passenger
Phusion Passenger,亦即mod_rails,可用于Apache或nginx的快速部署模块。
安装
gem install passenger
passenger-install-apache2-module
虚拟主机配置
<Virtualhost *:80>
ServerName hostname
DocumentRoot /home/muzik/workspace/appname/public/
RailsEnv development #默认为production
<Directory /home/muzik/workspace/appname/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
ErrorLog /home/muzik/workspace/appname/log/error.log
CustomLog /home/muzik/workspace/appname/log/access.log combined
</Virtualhost>
出现的问题
Missing the Rails 2.3.4 gem.
完整的错误提示:
Missing the Rails 2.3.4 gem. Please `gem install -v=2.3.4 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
事实上,需要的gem都是安装过的,只是它找不到罢了。在config/environment.rb里添加上就好了:
ENV['GEM_PATH'] = "/home/muzik/.gem/ruby/1.8:#{ENV['GEM_PATH']}"


06. 十一, 2009 