2017-03-09 67 views
0

這裏是終端的結果:所以用語言拘留問題的錯誤是使用命令「$混帳推Heroku的主人」部署Ruby on Rails的應用的Heroku被拒絕說沒有檢測到默認的語言包

tom100j:~/workspace/hello_app (master) $ git push heroku master 
Counting objects: 133, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (118/118), done. 
Writing objects: 100% (133/133), 24.39 KiB | 0 bytes/s, done. 
Total 133 (delta 27), 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 murmuring-stream-98615. 
remote: 
To https://git.heroku.com/murmuring-stream-98615.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 
'https://git.heroku.com/murmuring-stream-98615.git' 
tom100j:~/workspace/hello_app (master) $ 

我有試圖解決問題,甚至在應用程序中更改ruby的版本。 gemfile在下面。

source 'https://rubygems.org' 
ruby "2.3.0" 

git_source(:github) do |repo_name| 
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 
    "https://github.com/#{repo_name}.git" 
end 



gem 'rails', '~> 5.0.1' 
gem 'puma', '~> 3.0' 
gem 'sass-rails', '~> 5.0' 
gem 'uglifier', '>= 1.3.0' 
gem 'coffee-rails', '~> 4.2' 
gem 'jquery-rails' 
gem 'turbolinks', '~> 5' 
gem 'jbuilder', '~> 2.5' 

group :development, :test doconsole 
    gem 'sqlite3', '1.3.12' 
    gem 'byebug', platform: :mri 
end 

group :development do 
    gem 'web-console', '>= 3.3.0' 
    gem 'listen', '~> 3.0.5' 
    gem 'spring' 
    gem 'spring-watcher-listen', '~> 2.0.0' 
end 

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby, :ruby] 

group :production do 
    gem 'pg', '0.18.4' 
end 

有人對此有何解決方案?

+0

建議https://devcenter.heroku.com/articles/ruby-support –

+0

你有'gemfile'小寫字母的機會嗎?或者也許你忘了將它添加到存儲庫?如果你添加了官方的ruby buildpack,它應該只檢查'Gemfile'。 –

+0

@MichałMłoźniak_gemfile_就像'Gemfile',它已經被添加到回購。 –

回答

0

的Heroku無法檢測到buildpack您的應用程序需要

Buildpacks是負責將部署的代碼成栓,然後可以在測功機執行。

首先,你應該檢查是否有任何buildpack運行的應用程序設置,如果那裏有沒有,你應該看到以下消息

$ heroku buildpacks 
APP_NAME has no Buildpack URL set. 

如果有通過issueing

一個buildpack已經選定,你可以將其刪除
$ heroku buildpacks:clear 

然後通過運行

手動設定應用程序的buildpack 0

嘗試再次推送應用程序。如果繼續失敗,您應該檢查 Gemfile.lock文件包含railties gem,並且gem版本大於或等於5.0.0.beta,並且小於6.0.0。如Heroku Ruby Support for Rails 5.x applications

+0

其實我已經試過了。清理buildpack並將其設置爲與您提到的步驟完全相同的ruby。在這種情況下,錯誤會稍微改變爲*無法檢測到應用程序匹配沒有構建包*和引用[檢測失敗](https://devcenter.heroku.com/articles/buildpacks#detection-failure)根據文檔,作爲只要gemfile在根目錄下,它應該能夠檢測到。 Railties寶石是** railties(5.0.2)** –

相關問題