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
Ruby on rails Heroku推送错误“;无法检测rake任务“;_Ruby On Rails_Heroku - Fatal编程技术网

Ruby on rails Heroku推送错误“;无法检测rake任务“;

Ruby on rails Heroku推送错误“;无法检测rake任务“;,ruby-on-rails,heroku,Ruby On Rails,Heroku,我刚刚创建了一个新的Rails 6.1.1应用程序,并在本地将其链接到PostgreSQL数据库。因此,当您现在使用Rails s时,它仍然会显示欢迎使用Rails屏幕。我首先尝试将它部署到Heroku,作为一个起点。但是,我一直遇到一个推送错误,表示它无法检测到rake任务。这是一个新生成的Rails 6.1.1应用程序,我找不到任何文献来解决这个问题。Gemfile的:development或:tests组中似乎没有任何需要生产级的内容 生成输出: patrick@Patricks-MBP

我刚刚创建了一个新的Rails 6.1.1应用程序,并在本地将其链接到PostgreSQL数据库。因此,当您现在使用Rails s时,它仍然会显示欢迎使用Rails屏幕。我首先尝试将它部署到Heroku,作为一个起点。但是,我一直遇到一个推送错误,表示它无法检测到rake任务。这是一个新生成的Rails 6.1.1应用程序,我找不到任何文献来解决这个问题。Gemfile的:development或:tests组中似乎没有任何需要生产级的内容

生成输出:

patrick@Patricks-MBP dbsan % git push heroku master
Enumerating objects: 112, done.
Counting objects: 100% (112/112), done.
Delta compression using up to 12 threads
Compressing objects: 100% (94/94), done.
Writing objects: 100% (112/112), 152.47 KiB | 6.35 MiB/s, done.
Total 112 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-18 stack
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.1.4
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.6.3
remote: -----> Installing dependencies using bundler 2.1.4
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        The dependency byebug (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86_64-darwin-19 but the dependency is only for ruby, x86-mingw32, x64-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform ruby x86-mingw32 x64-mingw32`.
remote:        The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86_64-darwin-19 but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
remote:        Fetching gem metadata from https://rubygems.org/............
remote:        Fetching rake 13.0.3
remote:        Installing rake 13.0.3
remote:        Fetching concurrent-ruby 1.1.7
remote:        Fetching zeitwerk 2.4.2
remote:        Fetching minitest 5.14.3
remote:        Installing minitest 5.14.3
remote:        Installing zeitwerk 2.4.2
remote:        Installing concurrent-ruby 1.1.7
remote:        Fetching builder 3.2.4
remote:        Installing builder 3.2.4
remote:        Fetching erubi 1.10.0
remote:        Installing erubi 1.10.0
remote:        Fetching crass 1.0.6
remote:        Fetching racc 1.5.2
remote:        Installing crass 1.0.6
remote:        Installing racc 1.5.2 with native extensions
remote:        Fetching rack 2.2.3
remote:        Installing rack 2.2.3
remote:        Fetching nio4r 2.5.4
remote:        Installing nio4r 2.5.4 with native extensions
remote:        Fetching websocket-extensions 0.1.5
remote:        Installing websocket-extensions 0.1.5
remote:        Fetching mimemagic 0.3.5
remote:        Installing mimemagic 0.3.5
remote:        Fetching mini_mime 1.0.2
remote:        Installing mini_mime 1.0.2
remote:        Fetching msgpack 1.3.3
remote:        Installing msgpack 1.3.3 with native extensions
remote:        Using bundler 2.1.4
remote:        Fetching ffi 1.14.2
remote:        Installing ffi 1.14.2 with native extensions
remote:        Fetching method_source 1.0.0
remote:        Installing method_source 1.0.0
remote:        Fetching pg 1.2.3
remote:        Installing pg 1.2.3 with native extensions
remote:        Fetching thor 1.0.1
remote:        Installing thor 1.0.1
remote:        Fetching tilt 2.0.10
remote:        Installing tilt 2.0.10
remote:        Fetching semantic_range 2.3.1
remote:        Installing semantic_range 2.3.1
remote:        Fetching turbolinks-source 5.2.0
remote:        Installing turbolinks-source 5.2.0
remote:        Fetching i18n 1.8.7
remote:        Installing i18n 1.8.7
remote:        Fetching tzinfo 2.0.4
remote:        Installing tzinfo 2.0.4
remote:        Fetching rack-test 1.1.0
remote:        Installing rack-test 1.1.0
remote:        Fetching rack-proxy 0.6.5
remote:        Installing rack-proxy 0.6.5
remote:        Fetching sprockets 4.0.2
remote:        Installing sprockets 4.0.2
remote:        Fetching websocket-driver 0.7.3
remote:        Installing websocket-driver 0.7.3 with native extensions
remote:        Fetching marcel 0.3.3
remote:        Installing marcel 0.3.3
remote:        Fetching mail 2.7.1
remote:        Installing mail 2.7.1
remote:        Fetching nokogiri 1.11.1 (x86_64-linux)
remote:        Installing nokogiri 1.11.1 (x86_64-linux)
remote:        Fetching puma 5.1.1
remote:        Installing puma 5.1.1 with native extensions
remote:        Fetching bootsnap 1.5.1
remote:        Installing bootsnap 1.5.1 with native extensions
remote:        Fetching turbolinks 5.2.1
remote:        Installing turbolinks 5.2.1
remote:        Fetching activesupport 6.1.1
remote:        Installing activesupport 6.1.1
remote:        Fetching sassc 2.4.0
remote:        Installing sassc 2.4.0 with native extensions
remote:        Fetching loofah 2.9.0
remote:        Installing loofah 2.9.0
remote:        Fetching rails-dom-testing 2.0.3
remote:        Installing rails-dom-testing 2.0.3
remote:        Fetching globalid 0.4.2
remote:        Installing globalid 0.4.2
remote:        Fetching activemodel 6.1.1
remote:        Installing activemodel 6.1.1
remote:        Fetching jbuilder 2.10.1
remote:        Installing jbuilder 2.10.1
remote:        Fetching rails-html-sanitizer 1.3.0
remote:        Installing rails-html-sanitizer 1.3.0
remote:        Fetching activejob 6.1.1
remote:        Installing activejob 6.1.1
remote:        Fetching activerecord 6.1.1
remote:        Installing activerecord 6.1.1
remote:        Fetching actionview 6.1.1
remote:        Installing actionview 6.1.1
remote:        Fetching actionpack 6.1.1
remote:        Installing actionpack 6.1.1
remote:        Fetching actioncable 6.1.1
remote:        Fetching activestorage 6.1.1
remote:        Installing actioncable 6.1.1
remote:        Installing activestorage 6.1.1
remote:        Fetching actionmailer 6.1.1
remote:        Installing actionmailer 6.1.1
remote:        Fetching railties 6.1.1
remote:        Fetching sprockets-rails 3.2.2
remote:        Installing sprockets-rails 3.2.2
remote:        Fetching actionmailbox 6.1.1
remote:        Installing railties 6.1.1
remote:        Installing actionmailbox 6.1.1
remote:        Fetching actiontext 6.1.1
remote:        Installing actiontext 6.1.1
remote:        Fetching rails 6.1.1
remote:        Fetching webpacker 5.2.1
remote:        Installing rails 6.1.1
remote:        Installing webpacker 5.2.1
remote:        Fetching sassc-rails 2.1.2
remote:        Installing sassc-rails 2.1.2
remote:        Fetching sass-rails 6.0.0
remote:        Installing sass-rails 6.0.0
remote:        Bundle complete! 17 Gemfile dependencies, 57 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Post-install message from i18n:
remote:        
remote:        HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
remote:        But that may break your application.
remote:        
remote:        If you are upgrading your Rails application from an older version of Rails:
remote:        
remote:        Please check your Rails app for 'config.i18n.fallbacks = true'.
remote:        If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
remote:        'config.i18n.fallbacks = [I18n.default_locale]'.
remote:        If not, fallbacks will be broken in your app by I18n 1.1.x.
remote:        
remote:        If you are starting a NEW Rails application, you can ignore this notice.
remote:        
remote:        For more info see:
remote:        https://github.com/svenfuchs/i18n/releases/tag/v1.1.0
remote:        
remote:        Bundle completed (219.59s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Installing yarn-v1.22.4
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:  !     /tmp/build_d3723666/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError)
remote:  !     from /tmp/build_d3723666/config/boot.rb:4:in `<top (required)>'
remote:  !     from /tmp/build_d3723666/bin/rake:3:in `require_relative'
remote:  !     from /tmp/build_d3723666/bin/rake:3:in `<main>'
remote:  !
remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/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: /tmp/build_d3723666/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError)
remote:     from /tmp/build_d3723666/config/boot.rb:4:in `<top (required)>'
remote:     from /tmp/build_d3723666/bin/rake:3:in `require_relative'
remote:     from /tmp/build_d3723666/bin/rake:3:in `<main>'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:1106:in `rake'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:78:in `block (2 levels) in run_assets_precompile_rake_task'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:190:in `log'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:72:in `block in run_assets_precompile_rake_task'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:50:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:46:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:71:in `run_assets_precompile_rake_task'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:116:in `block (2 levels) in compile'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:1127:in `allow_git'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:109:in `block in compile'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:50:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:46:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:94:in `compile'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails2.rb:62:in `block in compile
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:50:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:46:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails2.rb:60:in `compile'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails3.rb:42:in `block in compile
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:50:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:46:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails3.rb:41:in `compile'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:35:in `block in compile
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:50:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:46:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:34:in `compile'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails6.rb:20:in `block in compile
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:50:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:46:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails6.rb:18:in `compile'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:20:in `block (2 levels) in <main>'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:190:in `log'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:19:in `block in <main>'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:35:in `block in trace'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:35:in `trace'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:15:in `<main>'
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 906ae42cc8a1c7ad4cc8ad166d4d9c43d9cecc63
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 906ae42cc8a1c7ad4cc8ad166d4d9c43d9cecc63
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to dbsan.
remote: 
To https://git.heroku.com/dbsan.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/dbsan.git'
patrick@Patricks-MBP dbsan % 

如果需要,我可以用Gemfile信息回复,但这篇文章不适合。

在heroku环境变量中添加这个RAILS\u SERVE\u STATIC\u文件,并将其值设置为true。

我找到了答案。此线程中列出的错误与Heroku-16堆栈有关。所以我去创建了一个新的rails项目,这次我尝试了Heroku创建。这将它放在Heroku-20堆栈上,该堆栈不支持ruby 2.6.3


因此,在安装ruby 3.0.0并重新生成rails应用程序以进行另一个Heroku创建之后,将其推送到Heroku-20堆栈中效果良好。关于rake任务,现在没有任何错误。

您可以试试
RAILS\u ENV=production bundle exec rake-p
?它说使用生产环境来运行它。也可以试试git push heroku master:main,在错误消息的末尾也有类似的内容。这是否回答了您的问题?不,这也不能解决问题。我在Heroku设置中也设置了这个键值ENV。完成了,但是git push Heroku master仍然会抛出相同的“无法检测到rake任务”,如果我使用git push Heroku master:main。请尝试此命令并再次部署RAILS\u ENV=production bundle exec rake assets:precompile,希望它能工作。运行良好,因此,我尝试了部署,但它仍然抛出相同的错误。所以我又运行了一次,现在它显示已经更新了,没什么可做的。因此,我尝试将预编译提交到Git,然后推送,但是配合是干净的,因此没有任何东西可以保存到Git。
patrick@Patricks-MBP dbsan % bundle exec rake -P
rake about
    environment
rake action_mailbox:ingress:environment
rake action_mailbox:ingress:exim
    action_mailbox:ingress:environment
rake action_mailbox:ingress:postfix
    action_mailbox:ingress:environment
rake action_mailbox:ingress:qmail
    action_mailbox:ingress:environment
rake action_mailbox:install
rake action_mailbox:install:migrations
rake action_text:install
rake action_text:install:migrations
rake active_storage:install
    environment
rake active_storage:install:migrations
rake active_storage:update
    environment
rake app:binstub:yarn
rake app:template
    environment
rake app:templates:copy
rake app:update
    update:configs
    update:bin
    update:active_storage
    update:upgrade_guide_info
rake app:update:active_storage
rake app:update:bin
rake app:update:configs
rake app:update:upgrade_guide_info
rake assets:clean
    environment
rake assets:clobber
    environment
rake assets:environment
rake assets:precompile
    environment
    yarn:install
rake cache_digests:dependencies
    environment
rake cache_digests:nested_dependencies
    environment
rake db:_dump
rake db:abort_if_pending_migrations
    load_config
rake db:charset
    load_config
rake db:check_protected_environments
    load_config
rake db:collation
    load_config
rake db:create
    load_config
rake db:create:all
    load_config
rake db:drop
    load_config
    check_protected_environments
rake db:drop:_unsafe
    load_config
rake db:drop:all
    load_config
    check_protected_environments
rake db:environment:set
    load_config
rake db:fixtures:identify
    load_config
rake db:fixtures:load
    load_config
rake db:forward
    load_config
rake db:load_config
    environment
rake db:migrate
    load_config
rake db:migrate:down
    load_config
rake db:migrate:redo
    load_config
rake db:migrate:reset
    db:drop
    db:create
    db:migrate
rake db:migrate:status
    load_config
rake db:migrate:up
    load_config
rake db:prepare
    load_config
rake db:purge
    load_config
    check_protected_environments
rake db:purge:all
    load_config
    check_protected_environments
rake db:reset
    db:drop
    db:setup
rake db:rollback
    load_config
rake db:schema:cache:clear
    load_config
rake db:schema:cache:dump
    load_config
rake db:schema:dump
    load_config
rake db:schema:load
    load_config
    check_protected_environments
rake db:schema:load_if_ruby
    db:create
    environment
rake db:seed
    load_config
rake db:seed:replant
    load_config
    truncate_all
    seed
rake db:setup
    db:create
    environment
    db:schema:load
    seed
rake db:structure:dump
    load_config
rake db:structure:load
    load_config
    check_protected_environments
rake db:structure:load_if_sql
    db:create
    environment
rake db:test:load
    db:test:purge
rake db:test:load_schema
    db:test:purge
rake db:test:load_structure
    db:test:purge
rake db:test:prepare
    load_config
rake db:test:purge
    load_config
    check_protected_environments
rake db:truncate_all
    load_config
    check_protected_environments
rake db:version
    load_config
rake default
    test
rake environment
rake log:clear
rake middleware
    environment
rake railties:install:migrations
    db:load_config
rake restart
rake secret
rake stats
rake test
rake test:all
    test:prepare
rake test:channels
    test:prepare
rake test:controllers
    test:prepare
rake test:db
    db:test:prepare
    test
rake test:functionals
    test:prepare
rake test:generators
    test:prepare
rake test:helpers
    test:prepare
rake test:integration
    test:prepare
rake test:jobs
    test:prepare
rake test:mailboxes
    test:prepare
rake test:mailers
    test:prepare
rake test:models
    test:prepare
rake test:prepare
rake test:run
    test
rake test:system
    test:prepare
rake test:units
    test:prepare
rake time:zones
rake time:zones:all
rake time:zones:local
rake time:zones:us
rake tmp
rake tmp/cache
rake tmp/cache/assets
rake tmp/pids
rake tmp/sockets
rake tmp:cache:clear
rake tmp:clear
    tmp:cache:clear
    tmp:sockets:clear
    tmp:screenshots:clear
rake tmp:create
    tmp/cache
    tmp/sockets
    tmp/pids
    tmp/cache/assets
rake tmp:pids:clear
rake tmp:screenshots:clear
rake tmp:sockets:clear
rake webdrivers:chromedriver:remove
rake webdrivers:chromedriver:update
rake webdrivers:chromedriver:version
rake webdrivers:edgedriver:remove
rake webdrivers:edgedriver:update
rake webdrivers:edgedriver:version
rake webdrivers:geckodriver:remove
rake webdrivers:geckodriver:update
rake webdrivers:geckodriver:version
rake webdrivers:iedriver:remove
rake webdrivers:iedriver:update
rake webdrivers:iedriver:version
rake webpacker
rake webpacker:binstubs
    check_node
    check_yarn
rake webpacker:check_binstubs
rake webpacker:check_node
rake webpacker:check_yarn
rake webpacker:clean
    webpacker:verify_install
    environment
rake webpacker:clobber
    webpacker:verify_install
    environment
rake webpacker:compile
    webpacker:verify_install
    environment
rake webpacker:info
rake webpacker:install
    check_node
    check_yarn
rake webpacker:install:angular
    webpacker:verify_install
rake webpacker:install:coffee
    webpacker:verify_install
rake webpacker:install:elm
    webpacker:verify_install
rake webpacker:install:erb
    webpacker:verify_install
rake webpacker:install:react
    webpacker:verify_install
rake webpacker:install:stimulus
    webpacker:verify_install
rake webpacker:install:svelte
    webpacker:verify_install
rake webpacker:install:typescript
    webpacker:verify_install
rake webpacker:install:vue
    webpacker:verify_install
rake webpacker:verify_install
    check_node
    check_yarn
    check_binstubs
rake webpacker:yarn_install
rake yarn:install
rake zeitwerk:check
    environment
patrick@Patricks-MBP dbsan %