作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在学习 https://www.railstutorial.org/book 上的教程.我们制作了一个非常简单的“hello world”应用程序,然后在第一章结束时将其推送到heroku。该应用程序在本地运行良好,但在尝试将其推送到 heroku 时出现一堆错误。
有关于格式不正确的 binstub 的警告、关于无法检测 rake 任务的错误、编译失败以及关于已构建相同版本代码的警告。这几乎是我的第一个 Rails 项目,也是第一次部署 heroku,所以很多这些错误对我来说绝对是零意义,我不确定是什么破坏了它。
> root@localhost:~/environment/hello_app# git push heroku main
> Enumerating objects: 146, done. Counting objects: 100% (146/146),
> done. Delta compression using up to 8 threads Compressing objects:
> 100% (127/127), done. Writing objects: 100% (146/146), 110.94 KiB |
> 1.98 MiB/s, done. Total 146 (delta 30), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote:
> remote: -----> Building on the Heroku-20 stack remote: ! Warning:
> Multiple default buildpacks reported the ability to handle this app.
> The first buildpack in the list below will be used. remote:
> Detected buildpacks: Ruby,Node.js remote: See
> https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
> remote: -----> Ruby app detected remote: -----> Installing bundler
> 1.17.3 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: remote:
> ###### WARNING: remote: remote: Improperly formatted binstubs detected in your project remote: remote: The following
> file(s) have appear to contain a problematic "shebang" line remote:
> remote: - bin/bundle remote: remote: For
> example bin/bundle has the shebang line: remote: remote:
> ``` remote: #!/usr/bin/env ruby2.7 remote: ``` remote:
> remote: It should be: remote: remote: ```
> remote: #!/usr/bin/env ruby remote: ``` remote:
> remote: A malformed shebang line may cause your program to
> crash. remote: remote: For more information about
> binstubs and "shebang" lines see: remote:
> https://devcenter.heroku.com/articles/bad-ruby-binstub-shebang remote:
> remote: -----> Using Ruby version: ruby-2.6.6 remote: ----->
> Installing dependencies using bundler 1.17.3 remote: Running:
> BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle
> BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1
> BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4 remote:
> The dependency byebug (= 11.1.3) will be unused by any of the
> platforms Bundler is installing for. Bundler is installing for
> aarch64-linux 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: 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.8 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.8 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 mini_portile2 2.5.0 remote: Fetching racc 1.5.2 remote:
> Installing mini_portile2 2.5.0 remote: Installing racc 1.5.2
> with native extensions remote: Fetching crass 1.0.6 remote:
> Installing crass 1.0.6 remote: Fetching rack 2.2.3 remote:
> Fetching nio4r 2.5.5 remote: Installing rack 2.2.3 remote:
> Installing nio4r 2.5.5 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.4.2 remote: Installing msgpack 1.4.2 with
> native extensions remote: Using bundler 2.1.2 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 0.20.0
> remote: Installing pg 0.20.0 with native extensions remote:
> Fetching thor 1.1.0 remote: Installing thor 1.1.0 remote:
> Fetching tilt 2.0.10 remote: Installing tilt 2.0.10 remote:
> Fetching turbolinks-source 5.2.0 remote: Installing
> turbolinks-source 5.2.0 remote: Fetching i18n 1.8.9 remote:
> Installing i18n 1.8.9 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.0.4
> remote: Installing puma 5.0.4 with native extensions remote:
> Fetching bootsnap 1.4.6 remote: Installing bootsnap 1.4.6 with
> native extensions remote: Fetching turbolinks 5.2.1 remote:
> Installing turbolinks 5.2.1 remote: Fetching activesupport
> 6.1.0 remote: Installing activesupport 6.1.0 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.0 remote: Installing
> activemodel 6.1.0 remote: Fetching jbuilder 2.10.0 remote:
> Installing jbuilder 2.10.0 remote: Fetching
> rails-html-sanitizer 1.3.0 remote: Installing
> rails-html-sanitizer 1.3.0 remote: Fetching activejob 6.1.0
> remote: Installing activejob 6.1.0 remote: Fetching
> activerecord 6.1.0 remote: Installing activerecord 6.1.0
> remote: Fetching actionview 6.1.0 remote: Installing
> actionview 6.1.0 remote: Fetching actionpack 6.1.0 remote:
> Installing actionpack 6.1.0 remote: Fetching actioncable 6.1.0
> remote: Fetching activestorage 6.1.0 remote: Installing
> actioncable 6.1.0 remote: Installing activestorage 6.1.0
> remote: Fetching actionmailer 6.1.0 remote: Installing
> actionmailer 6.1.0 remote: Fetching railties 6.1.0 remote:
> Fetching sprockets-rails 3.2.2 remote: Installing railties
> 6.1.0 remote: Installing sprockets-rails 3.2.2 remote: Fetching actionmailbox 6.1.0 remote: Installing actionmailbox
> 6.1.0 remote: Fetching actiontext 6.1.0 remote: Installing actiontext 6.1.0 remote: Fetching rails 6.1.0
> remote: Fetching webpacker 4.2.2 remote: Installing
> rails 6.1.0 remote: Installing webpacker 4.2.2 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: Bundle completed
> (254.77s) 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_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:91:in
> `block in materialize': Could not find rake-13.0.3 in any of the
> sources (Bundler::GemNotFound) remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:85:in
> `map!' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:85:in
> `materialize' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/definition.rb:170:in
> `specs' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/definition.rb:237:in
> `specs_for' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/definition.rb:226:in
> `requested_specs' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:108:in
> `block in definition_method' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:20:in
> `setup' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler.rb:107:in
> `setup' remote: ! from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/setup.rb:20:in
> `<top (required)>' remote: ! from
> /tmp/build_e4e63d0f/vendor/ruby-2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
> `require' remote: ! from
> /tmp/build_e4e63d0f/vendor/ruby-2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
> `require' remote: ! from /tmp/build_e4e63d0f/config/boot.rb:3:in
> `<top (required)>' remote: ! from
> /tmp/build_e4e63d0f/bin/rake:3:in `require_relative' remote: !
> from /tmp/build_e4e63d0f/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_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:91:in
> `block in materialize': Could not find rake-13.0.3 in any of the
> sources (Bundler::GemNotFound) remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:85:in
> `map!' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/spec_set.rb:85:in
> `materialize' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/definition.rb:170:in
> `specs' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/definition.rb:237:in
> `specs_for' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/definition.rb:226:in
> `requested_specs' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:108:in
> `block in definition_method' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:20:in
> `setup' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler.rb:107:in
> `setup' remote: from
> /tmp/build_e4e63d0f/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/setup.rb:20:in
> `<top (required)>' remote: from
> /tmp/build_e4e63d0f/vendor/ruby-2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
> `require' remote: from
> /tmp/build_e4e63d0f/vendor/ruby-2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
> `require' remote: from /tmp/build_e4e63d0f/config/boot.rb:3:in `<top
> (required)>' remote: from /tmp/build_e4e63d0f/bin/rake:3:in
> `require_relative' remote: from /tmp/build_e4e63d0f/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-20/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-20/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-20/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-20/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-20/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-20/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-20/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:
> d3c258ea1dbc2f62936807e7363562fb7f66e9de remote: ! remote: ! We have
> detected that you have triggered a build from source code with version
> d3c258ea1dbc2f62936807e7363562fb7f66e9de 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
> floating-ocean-22006. remote: To
> https://git.heroku.com/floating-ocean-22006.git ! [remote rejected]
> main -> main (pre-receive hook declined) error: failed to push some
> refs to 'https://git.heroku.com/floating-ocean-22006.git'
最佳答案
您收到错误,这意味着您为应用程序设置了多个堆栈。所以堆栈实际上是用于不同应用程序的平台。现在,如果您使用的是 rails,那么您应该指定您的平台。您可以使用以下命令检查有多少不同的堆栈可用
heroku stack
还要检查你的 buildpack,确保它是 heroku/ruby,以防我在下一个命令中设置。
heroku buildpacks
现在通过运行以下命令选择您喜欢的堆栈,并将 buildpacks 更改为 heroku/ruby
heroku stack:set heroku-20
heroku buildpacks:set heroku/ruby
上面的命令会将你的堆栈更改为 ruby 的 heroku-20,昨晚我用它来部署 rails 6 应用程序。
git push heroku main
仍然问题然后您可以尝试以下命令
heroku run bundle exec rake rails:update:bin
如果您更改堆栈,它应该可以工作,但仍然存在问题,您可以尝试将堆栈更改为
heroku-18
然后再做一次
git push heroku main
main
是分支,您可以更改为 master
如果您使用 master 作为主要分支。 关于ruby-on-rails - 将简单的 Rails 项目推送到 Heroku 时出错,推送被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66231620/
我是一名优秀的程序员,十分优秀!