[英]Heroku push error: "Could not detect rake tasks" ( Rails 6.1 )
[英]heroku push of Rails 3.2 app suddenly fails with “Could not detect rake tasks” (no other errors)
我沒有更改配置(沒有新的 gem 或版本更改); 只有一行代碼,但我現在無法推送到 heroku。 heroku 一定有什么變化?
它是 Rails 3.2.22.5; Ruby 2.3.1。 (是的,我正在升級到 Rails 5,但這是一項艱巨的工作,同時我還需要維護現有的生產系統。)
RAILS_ENV=production bundle exec rake -P 工作正常。 我不認為這真的是一個rake問題。 我最好的猜測是 heroku 發生了一些變化,以至於不再支持我擁有的某些版本,但我不知道是什么。 而且我沒有收到任何信息性錯誤消息。
不知所措...我已經廣泛搜索了谷歌,但大多數帖子都是 4 歲以上。 我嘗試在本地預編譯並僅簽入清單文件。 我嘗試升級 rake(從 13.0.0 到 13.0.1),並且因為沒有任何效果而將所有東西都放回去了。
remote: Bundle complete! 54 Gemfile dependencies, 118 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into `./vendor/bundle`
remote: Bundle completed (0.51s)
remote: Cleaning up the bundler cache.
remote: -----> Writing config/database.yml to read from DATABASE_URL
remote: -----> Installing node-v12.16.2-linux-x64
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: ! bash: /tmp/build_785c3bf77f08cff81f442938e3386876/bin/rake: /app/vendor/ruby-2.3.1/bin/ruby: bad interpreter: No such file or directory
remote: !
remote: /tmp/buildpackvv7B3/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
我詢問了 heroku 支持,他們發現了問題。 正如預期的那樣,與 rake 或我的項目本身無關(因為我沒有改變任何東西)。
它與構建包有關。 我需要一個 PDF 生成器,所以我設置了一個“多構建包”(幾年前完成),顯然以不再受支持的方式。 我相信最直接的原因是指向“主”構建包,而不是穩定版本。 所以有人在 heroku 上檢查了一些東西,它破壞了我的項目:) 它可能只會影響幾年前在舊雪松堆棧上設置它的人,就像我一樣。
我跑了:
heroku buildpacks:remove https://github.com/heroku/heroku-buildpack-multi.git
heroku buildpacks:add heroku/ruby
heroku buildpacks:add https://github.com/dscout/wkhtmltopdf-buildpack.git
並能夠再次部署!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.