2015-05-06 20 views
3

我試圖部署我的Ruby on Rails應用程序時得到了這個錯誤。這裏是我的命令行錯誤:沒有檢測到Procfile,使用默認的Web服務器(webrick)

###### WARNING: 
remote:  No Procfile detected, using the default web server (webrick) 
remote:  https://devcenter.heroku.com/articles/ruby-default-web-server 

remote: 
remote: -----> Discovering process types 
remote:  Procfile declares types -> (none) 
remote:  Default types for Ruby -> console, rake, web, worker 
remote: 
remote: -----> Compressing... done, 29.5MB 
remote: -----> Launching... done, v21 
remote:  https://agile-sea-1900.herokuapp.com/ deployed to Heroku 
remote: 
remote: Verifying deploy... done. 
To https://git.heroku.com/agile-sea-1900.git 
    e5d3ad8..975d5eb master -> master 

我試着按照「No Procfile detected, using the default web server」的意見,但沒有幫助。

+1

我沒有看到任何錯誤,只是警告。 「heroku日誌」顯示什麼? https://devcenter.heroku.com/articles/logging#log-retrieval –

+2

你的'Procfile'的內容是什麼? – infused

+1

確保P是Procfile中的大寫字母 –

回答

6

在評論中給出的信息之上,你因爲在你的Procfile有這樣的錯誤,你必須:

web: bundle exec rails server -p $PORT 

所以默認webrick將被使用。

爲了消除此警告,您應該使用另一個Web服務器,如獨角獸,瘦或彪馬。

Heroku現在主張使用Puma(見Changelog)。

要開始使用Puma和Heroku,您可以在Heroku網站上關注文章Deploying Rails Applications with the Puma Web Server

1

在我的情況下,由於其他在線指南頁面的原因,我忽略了.gitignore中的Procfile。那時,他們給出了隱藏文件的說明,這些文件聲明瞭包含郵件帳戶信息的環境變量。 因此,請檢查您的.gitignore文件,如果看到Procfile,請將其刪除。