Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sinatra应用程序赢得';不要发表给Heroku_Heroku_Sinatra - Fatal编程技术网

Sinatra应用程序赢得';不要发表给Heroku

Sinatra应用程序赢得';不要发表给Heroku,heroku,sinatra,Heroku,Sinatra,我有一个非常简单的Sinatra应用程序,我正试图发布给Heroku。我已经创建了帐户,并且应用程序在本地运行良好,但当我键入时: git push heroku master (from within the applications root folder) 我得到: -----> Heroku receiving push -----> Removing .DS_Store files ! Heroku push rejected, no Rails or Rack

我有一个非常简单的Sinatra应用程序,我正试图发布给Heroku。我已经创建了帐户,并且应用程序在本地运行良好,但当我键入时:

git push heroku master (from within the applications root folder)
我得到:

-----> Heroku receiving push
-----> Removing .DS_Store files
!     Heroku push rejected, no Rails or Rack app detected

To git@heroku.com:pure-mist-880.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:pure-mist-880.git' 
我的config.ru文件非常简单(可能是问题所在,因为我已经看到了几种不同的编写方法……):

但在本地运行良好。

我错过了什么?

简单就是好。我在Heroku上得到了一个Sinatra应用程序,它有一个
config.ru
文件:

require './app'
run App
app.rb
包含如下内容(它是一个模块化风格的应用程序):

class-App
感谢您的灵感。我从零开始使用像你这样的应用程序,意识到Heroku在抱怨,因为它找不到“sinatra/base”。我环顾四周,发现Heroku想要一个.gems清单,列出你的应用程序所需的所有gems。我为我的主应用程序写了一个,一切都好起来了(除了我的CSS…没有加载)。再次感谢!您应该使用Bundler(),而不仅仅是使用.gems文件。
require './app'
run App
class App < Sinatra::Base
  get '/' do
    # ...
  end
end