2010-09-29 153 views
1

我構建了一個小型應用程序,它在後端與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

+0

您是否需要配置生產數據庫? – shingara 2010-09-29 10:25:33

+0

我們可以有你的日誌嗎? – shingara 2010-09-29 10:26:07

+0

相同的應用程序正在使用mogrel.So我猜生產數據庫必須配置。但仍然我檢查database.yml文件一切都很好。 – gaurav 2010-09-29 10:27:26

回答

0

你需要在你的db/database.yml文件定義一個生產數據庫,並與所有遷移

RAILS_ENV=production rake db:create 
RAILS_ENV=production rake db:migrate 

創建該數據庫,或者如果你真的穿上」要使用生產環境,您可以更改您的乘客配置

+0

嗨shingara..RAILS_ENV =生產耙db:創建命令working..but當我運行下一個命令它給(./在/ usr/home/gaurav/demo/sample_app) rake中止! 密碼不是模塊 – gaurav 2010-10-01 09:59:59

+0

這是另一個問題。密碼是在我們的寶石,我想或您的代碼。 – shingara 2010-10-01 10:23:45