rails tutorialをやっていたのですがHerokuにデプロイできていないことに気が付きました。3時間ほどGoogleで検索を書けていますが一向に解決しません。具体的に言うとターミナルで
git push heroku master
と打つと
Terminal
1Counting objects: 127, done. 2Compressing objects: 100% (110/110), done. 3Writing objects: 100% (127/127), 153.70 KiB | 3.75 MiB/s, done. 4Total 127 (delta 5), reused 0 (delta 0) 5remote: Compressing source files... done. 6remote: Building source: 7remote: 8remote: -----> Building on the Heroku-20 stack 9remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. 10remote: Detected buildpacks: Ruby,Node.js 11remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order 12remote: -----> Ruby app detected 13remote: -----> Installing bundler 1.17.3 14remote: -----> Removing BUNDLED WITH version in the Gemfile.lock 15remote: -----> Compiling Ruby/Rails 16remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.3.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3. 17remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-20/ruby-2.6.3.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3. 18remote: 19remote: ! 20remote: ! The Ruby version you are trying to install does not exist on this stack. 21remote: ! 22remote: ! You are trying to install ruby-2.6.3 on heroku-20. 23remote: ! 24remote: ! Ruby ruby-2.6.3 is present on the following stacks: 25remote: ! 26remote: ! - cedar-14 27remote: ! - heroku-16 28remote: ! - heroku-18 29remote: ! 30remote: ! Heroku recommends you use the latest supported Ruby version listed here: 31remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes 32remote: ! 33remote: ! For more information on syntax for declaring a Ruby version see: 34remote: ! https://devcenter.heroku.com/articles/ruby-versions 35remote: ! 36remote: ! Push rejected, failed to compile Ruby app. 37remote: 38remote: ! Push failed 39remote: ! 40remote: ! ## Warning - The same version of this code has already been built: 2dc56620d26562f11b369e73f71139f88b51ad39 41remote: ! 42remote: ! We have detected that you have triggered a build from source code with version 2dc56620d26562f11b369e73f71139f88b51ad39 43remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. 44remote: ! 45remote: ! If you are developing on a branch and deploying via git you must run: 46remote: ! 47remote: ! git push heroku <branchname>:main 48remote: ! 49remote: ! This article goes into details on the behavior: 50remote: ! https://devcenter.heroku.com/articles/duplicate-build-version 51remote: 52remote: Verifying deploy... 53remote: 54remote: ! Push rejected to damp-inlet-19623. 55remote: 56To https://git.heroku.com/damp-inlet-19623.git 57 ! [remote rejected] master -> master (pre-receive hook declined) 58error: failed to push some refs to 'https://git.heroku.com/damp-inlet-19623.git'
と表示されます。
Gemfileは
source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.3' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.3' # Use sqlite3 as the database for Active Record # gem 'sqlite3', '~> 1.4' # Use Puma as the app server gem 'puma', '~> 4.1' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem 'webpacker', '~> 4.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Active Storage variant # gem 'image_processing', '~> 1.2' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.4.2', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'sqlite3' end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '~> 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end group :production do gem 'pg' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'slim-rails' gem 'html2slim' gem 'bcrypt'
で、database.ymlは
default: &default adapter: sqlite3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: <<: *default database: db/development.sqlite3 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: db/test.sqlite3 production: # <<: *default # database: db/production.sqlite3 adapter: postgresql encoding: unicode pool: 5 database: db/production.postgresql
です。
git init
git add -A
git commit
git remote add origin https://github.com/<私のGitHubアカウント名>/hello_app.git
git push origin master
herokuのversion確認、
heroku login --interactive
heroku create
まで完了しております。
どなたか解決方法をご教授いただけると幸いです。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/01/31 04:34