如何将基于Sinatra的Ruby Web应用程序部署到Heroku?

问题描述:

如何在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/。 –

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

结账Deploying Rack-based Apps heroku文档。你需要一个config.ru文件并且可能需要一个Procfile来启动你的网络服务器。