2016-03-04 79 views
0

如何在Heroku中部署基於Sinatra的Ruby Web應用程序?如何將基於Sinatra的Ruby Web應用程序部署到Heroku?

我有一個基於Sinatra的web application。當我想在本地運行它時,我做了以下操作:

  1. 在命令行中,我轉到目錄servers/dev
  2. 運行thin start -R songcontest.ru

現在我想部署相同的應用程序的Heroku。我遵循教程的前幾個步驟(step 1step 2step 3)。

現在我想運行git push heroku master,這是將應用程序部署到Heroku的下一步。當我這樣做,我得到了以下錯誤消息:

remote: !  Push rejected, no Cedar-supported app detected 
remote: HINT: This occurs when Heroku cannot detect the buildpack 
remote:  to use for this application automatically. 
remote: See https://devcenter.heroku.com/articles/buildpacks 

Push rejected

我怎樣才能解決這個問題(請在Heroku我的應用程序運行)?

+0

你看過錯誤信息中的推薦文章嗎? – thesecretmaster

+0

@祕書長是的。我設置了構建包,並將Gemfile放入根目錄。這(Gemfile的存在)是Ruby構建包的檢測腳本檢查的內容。但我仍然收到錯誤消息(生成包未檢測到)。我問Heroku對此的支持。當前版本可從https://github.com/dpisarenko/50web/tree/heroku獲得。我嘗試在本地運行應用程序('bundle install',然後'bundle exec rackup -p 9292 songcontest.ru')並且它工作了(一個頁面在'localhost:9292'處可用)。 –

+0

@thesecretmaster有關我迄今嘗試的更多詳細信息,請訪問http://altruix.cc/song-contest/deployment-on-heroku/。 –

回答

0

從其他分支部署到Heroku的主分支時,需要在push命令中指定分支:git push heroku heroku:master

2

結賬Deploying Rack-based Apps heroku文檔。你需要一個config.ru文件並且可能需要一個Procfile來啓動你的網絡服務器。

相關問題