簡體   English   中英

將Rails推到Heroku,找不到Rake taks

[英]Pushing Rails to Heroku, can't find Rake taks

更新:現在使用Ruby 2.5.5和Bundler 2.0.2,仍然出現錯誤:

/app/tmp/buildpacks/<long hash>/lib/language_pack/helpers/rake_runner.rb:106:
in load_rake_tasks!': 
Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)` 

我正在嘗試第一次git push heroku master送到Rails應用程序中,並且出現此錯誤:

remote: -----> Detecting rake tasks
remote:
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! Activating bundler (2.0.1) failed:
remote: ! Could not find 'bundler' (2.0.1) required by your /tmp/build_cf9981ccbdc1fd4f0b82703a5ff40ecc/Gemfile.lock.
remote: ! To update to the latest version installed on your system, run `bundle update --bundler`.
remote: ! To install the missing version, run `gem install bundler:2.0.1`
remote: ! Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
remote: !
remote: ! To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'`
remote: !
remote: /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
remote: ensure you can run `$ bundle exec rake -P` against your app
remote: and using the production group of your Gemfile.
remote: Activating bundler (2.0.1) failed:
remote: Could not find 'bundler' (2.0.1) required by your /tmp/build_cf9981ccbdc1fd4f0b82703a5ff40ecc/Gemfile.lock.
remote: To update to the latest version installed on your system, run `bundle update --bundler`.
remote: To install the missing version, run `gem install bundler:2.0.1`
remote: Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
remote:
remote: To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'`

我已經在此應用程序的根目錄中成功運行了gem install bundler:2.0.1 我的$GEM_PATH不包含vendor/bundle/ruby/2 ,並且我不知道是否更改它才是解決方案。 如果是這樣,是否意味着我需要在本地或遠程進行更改? 如果在本地,它是否與普通環境變量相同,或者是否需要更改特殊的Rails設置?

我在這里接受的答案中嘗試了該建議:

heroku推送錯誤:“無法檢測到耙任務”

但這沒什么區別。

我的問題似乎也與這里的(未回答)問題類似:

無法將Rails項目推向Heroku

搜索Heroku幫助中心似乎也沒有任何結果。

關於我應該做什么的任何指導?

這是Heroku上Bundler 2的一個已知問題

指定捆綁程序2.0.2的Gemfile.lock不適用於捆綁程序2.0.1

如果您嘗試將使用捆綁器2.0.2的應用程序部署到帶有捆綁器2.0.1的Heroku平台上,則可能會出現以下錯誤:

 `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) 

這是由於Rubygems捆綁程序版本檢查代碼中的錯誤所致。 為避免此問題,請升級您的Ruby版本。 它在2.5.5+和2.6.3+中已修復。 如果不更新,則為Ruby版本,則Bundler 2.x的每個新發行版都會觸發此問題。

在本地將Ruby升級到2.5.5+或2.6.3+版本,相應地更新您的Gemfile ,然后重新運行bundle 將更改提交到GemfileGemfile.lock ,然后再次部署。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM