【问题标题】:Why doesn't Heroku detects my Sinatra app?为什么 Heroku 没有检测到我的 Sinatra 应用程序?
【发布时间】:2020-03-16 21:06:02
【问题描述】:

我使用的是 Heroku 开发中心提供的最简单的结构和代码:

一个“hello.rb”文件

require 'sinatra'
get '/' do 
  "Hello World"
end

一个“config.ru”文件

require './hello'
run Sinatra::Application

一个“gemfile”文件

source 'https://rubygems.org'
gem 'sinatra'

我在终端上:

$git init
$heroku create
$bundle
$git add . 
$git commit -m "bundle"
$git push heroku master 

该应用程序与 heroku local 一起工作,但是当尝试推送任何 Sinatra 应用程序时,总是会收到相同的错误消息:

> Enumerating objects: 29, done. Counting objects: 100% (29/29), done.
> Delta compression using up to 12 threads Compressing objects: 100% (25/25), done. 
> Writing objects: 100% (29/29), 5.63 KiB | 1.88 MiB/s, done.
> Total 29 (delta 3), reused 0 (delta 0) remote: Compressing source files... done. 
> remote: Building source: 
> remote:  
> remote:  !   No default language could be detected for this app. 
> remote: HINT:This occurs when Heroku cannot detect the buildpack to use for this application automatically. 
> remote:           See https://devcenter.heroku.com/articles/buildpacks 
> remote:  
> remote:  !  Push failed remote: Verifying deploy... 
> remote:  
> remote: ! Push rejected to sinatrina. remote:

添加 procfile 或 bundlepack 总是返回与上面相同的消息。我错过了一步吗?

【问题讨论】:

标签: ruby git heroku deployment sinatra


【解决方案1】:

您的代码非常简单,我猜 Heroku 无法猜出语言。 尝试手动设置 buildpack:heroku buildpacks:set heroku/ruby --app your_app

请注意,首先您需要安装 Heroku CLI 并运行 heroku login 以登录您的帐户。

【讨论】:

    猜你喜欢
    • 2013-10-27
    • 2012-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-07
    • 1970-01-01
    • 2013-12-08
    • 2018-12-12
    相关资源
    最近更新 更多