railsとherokuのド素人です。
herokuというリモートリポジトリにpushしようと、次のコマンドを打ちました。
git push heroku master
すると、次の表示となりました。
Enumerating objects: 110, done. Counting objects: 100% (110/110), done. Delta compression using up to 4 threads Compressing objects: 100% (96/96), done. Writing objects: 100% (110/110), 25.93 KiB | 632.00 KiB/s, done. Total 110 (delta 2), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: 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: -----> Compiling Ruby/Rails remote: 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-18/ruby-2.3.3.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3. remote: 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-18/ruby-2.3.3.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3. remote: remote: ! remote: ! An error occurred while installing ruby-2.3.3 remote: ! remote: ! This version of Ruby is not available on Heroku-18. The minimum supported version remote: ! of Ruby on the Heroku-18 stack can found at: remote: ! remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to herokuherokuherokuappapp. remote: To https://git.heroku.com/****.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/****.git'
rubyのバージョンに対して、herokuは対応できませんよ。
だからプッシュは失敗しました。というメッセージだと受け止めています。
しかし、どうしたらいいのかわかりません。
ご教授下さい。よろしくお願いします。
Gemfileの内容はどのようになっていますか?追記をお願いします。
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.4.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'duktape'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', 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 :production do
gem 'pg'
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'
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 chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
rubyのバージョン管理はGemfileで行うとのことでしたが、自分の場合、Gemfileの記述自体を直接編集しました。(リモートリポジトリに対するrubyバージョンの宣言?という認識が働いたためです。)
しかし、実際にrubyの適切なバージョンをインストールしなければならないみたいですね。
https://qiita.com/newburu/items/bb31ef2b429b5557b45a
自分の環境はWindowsなのでrbenvは使えないみたいです。
ruby '2.4.5'はrubyinstallerにはなく、
https://www.ruby-lang.org/ja/downloads/
上記のサイトから入手したファイルの実行の仕方がわからない状態です。