2016-07-28 74 views
1

我想推入一些與Git的紅寶石代碼,並保持部分方式通過停止。這裏是我的設置和錯誤,我得到..Heroku部署錯誤:沒有默認語言

[email protected]:~/ruby# git remote -v 
heroku https://git.heroku.com/warm-woodland-27175.git (fetch) 
heroku https://git.heroku.com/warm-woodland-27175.git (push) 
[email protected]:~/ruby# ls 
config.ru myapp.rb 
[email protected]:~/ruby# git push heroku master 
Counting objects: 4, done. 
Compressing objects: 100% (3/3), done. 
Writing objects: 100% (4/4), 398 bytes | 0 bytes/s, done. 
Total 4 (delta 0), 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 warm-woodland-27175. 
remote: 
To https://git.heroku.com/warm-woodland-27175.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/warm-woodland- 27175.git' 
[email protected]:~/ruby# 

我仍然在試圖瞭解插件和Git的出局,但我很迷失,爲什麼Git並不在我的編譯文件夾識別文件擴展名。我認爲這是如何獲取使用什麼語言,.rb .pl等...任何幫助將不勝感激。

回答

3

我試圖將我的Sinatra應用程序部署到Heroku時發生此錯誤。

heroku buildpacks:set heroku/ruby 

我讀了https://devcenter.heroku.com/articles/buildpacks幫我完成了解決方案。

但我開始與https://devcenter.heroku.com/articles/rack 這讓我瞭解到,你需要爲Gemfile添加這樣等。確保你做的bundle install的文件。

確保您提交改變您添加的Gemfile後,等於是

git add . 

或任何你需要做的,然後提交

git commit -m "Added files for Heroku deployment" 

或更改消息,只要你想。然後您可以部署使用

git push heroku master 

現在,我有我的網站使用Heroku的

enter image description here

enter image description here

如果我失蹤,你需要的東西跑,只是問意見,所以我可以澄清。

1

當我試圖用Ruby Sinatra部署到Heroku時,我遇到了同樣的問題。我的情況是,我是Ruby和Sinatra的全新品牌,對於寶石和捆綁銷售一無所知。

我的字面上只有我的app.rb文件在文件夾中。 我採取了以下措施的基礎上,一些導遊1我讀:

如果我的應用程序被稱爲app.rb,創建一個名爲config.ru文件:

require './hello' 
run Sinatra::Application 

創建一個名爲Gemfile文件:

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

然後我發現this article提醒我,我需要運行bundle install

然後我將這些文件添加到我的混帳,推它,我的工作!