在apache上部署Rails应用程序
问题描述:
我构建了一个小型应用程序,它在后端与mysql进行交互。当我在mongrel服务器上运行时,它的行为很好。 我想在apache服务器上运行这个应用程序。 该应用程序是一个rails应用程序 操作系统是opensolaris 我试图修改apache中的httpd.conf,并在其中添加了下面的行。在apache上部署Rails应用程序
LoadModule passenger_module /var/ruby/1.8/gem_home/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /var/ruby/1.8/gem_home/gems/passenger-2.2.15
PassengerRuby /usr/ruby/1.8/bin/ruby
<VirtualHost *:80>
ServerName sampleapp.com
DocumentRoot /export/home/gaurav/test/sample_app/public
<Directory /export/home/gaurav/test/sample_app>
AllowOverride ALL
Order allow,deny
Allow from all
</Directory>
</VirtualHost>`
但即时通讯数据库错误。我检查错误的显示错误代码日志文件500
答
你需要在你的db/database.yml文件定义一个生产数据库,并与所有迁移
RAILS_ENV=production rake db:create
RAILS_ENV=production rake db:migrate
创建该数据库,或者如果你真的穿上”要使用生产环境,您可以更改您的乘客配置
您是否需要配置生产数据库? – shingara 2010-09-29 10:25:33
我们可以有你的日志吗? – shingara 2010-09-29 10:26:07
相同的应用程序正在使用mogrel.So我猜生产数据库必须配置。但仍然我检查database.yml文件一切都很好。 – gaurav 2010-09-29 10:27:26