0

我正在將我的Web應用程序部署到我的服務器,除非找不到方法來擺脫以下錯誤消息,否則一切正常。在部署之前,我有一個開發和production.rb文件在我的日誌中,但是當推送到服務器時,沒有任何內容,我無法創建它。我尋找其他解決方案,但迄今爲止沒有任何工作,我該如何解決這個錯誤?Rails 3無法訪問服務器上的日誌文件

Rails Error: Unable to access log file. Please ensure that 
/var/www/websites/public/appname/releases/20120608236602/log/production.log 
exists and is chmod 0666. The log level has been raised to WARN and 
the output directed to STDERR until the problem is fixed. 
+0

你如何部署你的應用程序? –

+0

@cheeseweasel我正在部署與capistrano – coletrain

+1

我相信默認情況下,Capistrano應該在appname/shared文件夾中設置日誌文件夾,並且發佈/ xxx/log應該是符號鏈接,是這種情況嗎? –

回答

1

由於該錯誤消息指出,日誌記錄進程無法訪問日誌文件。這是由於/var/www/websites/public/appname/releases/20120608236602/log上的權限造成的。

您可以更改與目錄的權限:

chmod -R 0666 /var/www/websites/public/appname/releases/20120608236602/log 
+0

我使用上面的sudo cmd,它可以工作,但是當試圖更新rails應用程序時,它不會。無論如何,默認情況下這樣做,所以我不必每次手動更改權限? – coletrain

+0

我會遵循@ cheeseweasel的建議在生產版本中使用符號鏈接。 – buruzaemon