解決したいこと
gitリモートリポジトリにあるアプリケーションをクローンして、それをherokuでデプロイすることを通して、herokuの使い方を勉強をしようとしています。
実行したこと
まずアプリケーションをクローンして、そのあとterminalを使ってherokuにログインしました。以下のコードを実行して、heroku上にアプリケーションを作成したところ、自動でthawing-lake-19173と名付けられました。
terminal
1heroku create
これによって、thawing-lake-19173.gitというリポジトリが生成されたようなので、そこにこちらのコードを実行してクローンしたアプリケーションをpushしようとしました。
terminal
1git push heroku master
コードを実行したところ、以下のエラーが発生しました。
terminal
1Enumerating objects: 222, done. 2Counting objects: 100% (222/222), done. 3Delta compression using up to 4 threads 4Compressing objects: 100% (118/118), done. 5Writing objects: 100% (222/222), 77.46 KiB | 25.82 MiB/s, done. 6Total 222 (delta 90), reused 222 (delta 90), pack-reused 0 7remote: Compressing source files... done. 8remote: Building source: 9remote: 10remote: -----> Ruby app detected 11remote: -----> Installing bundler 1.17.3 12remote: -----> Removing BUNDLED WITH version in the Gemfile.lock 13remote: -----> Compiling Ruby/Rails 14remote: 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. 15remote: 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. 16remote: 17remote: ! 18remote: ! The Ruby version you are trying to install does not exist on this stack. 19remote: ! 20remote: ! You are trying to install ruby-2.3.3 on heroku-18. 21remote: ! 22remote: ! Ruby ruby-2.3.3 is present on the following stacks: 23remote: ! 24remote: ! - cedar-14 25remote: ! - heroku-16 26remote: ! 27remote: ! Heroku recommends you use the latest supported Ruby version listed here: 28remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes 29remote: ! 30remote: ! For more information on syntax for declaring a Ruby version see: 31remote: ! https://devcenter.heroku.com/articles/ruby-versions 32remote: ! 33remote: ! Push rejected, failed to compile Ruby app. 34remote: 35remote: ! Push failed 36remote: Verifying deploy... 37remote: 38remote: ! Push rejected to thawing-lake-19173. 39remote: 40To https://git.heroku.com/thawing-lake-19173.git 41 ! [remote rejected] master -> master (pre-receive hook declined) 42error: failed to push some refs to 'https://git.heroku.com/thawing-lake-19173.git'
You are trying to install ruby-2.3.3 on heroku-18.
Ruby ruby-2.3.3 is present on the following stacks:
cedar-14
heroku-16
とあるのですが、herokuのstackを18から、あえて古い16に変更することは可能でしょうか?
stackが変更できない場合、それ以外の方法としては何をするのが良いでしょうか。
アプリケーションをpushするのに適した方法を教えていただきたいです。
よろしくお願いします。
追記として、アプリケーション内のGemfileは以下のようになっています。
Gemfile
1source 'https://rubygems.org' 2 3ruby "2.3.3" 4 5gem 'rspec' 6gem 'rspec-rails' 7gem 'rake' 8 9# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 10gem 'rails', '~> 4.2.0' 11# Use SCSS for stylesheets 12# gem 'sass-rails', '~> 5.0' 13# Use Uglifier as compressor for JavaScript assets 14# gem 'uglifier', '>= 1.3.0' 15# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 16# gem 'jbuilder', '~> 2.0' 17# bundle exec rake doc:rails generates the API under doc/api. 18# gem 'sdoc', '~> 0.4.0', group: :doc 19 20# Use ActiveModel has_secure_password 21# gem 'bcrypt', '~> 3.1.7' 22 23# Use Unicorn as the app server 24# gem 'unicorn' 25 26# Use Capistrano for deployment 27# gem 'capistrano-rails', group: :development 28 29group :development do 30 # Use sqlite3 as the database for Active Record 31 gem 'sqlite3' 32 # Access an IRB console on exception pages or by using <%= console %> in views 33 gem 'web-console', '~> 2.0' 34end 35 36group :production do 37 # Use postgresql as the database for Active Record 38 gem 'pg', '~> 0.15' 39 # Use easily Heroku with Rails 40 gem 'rails_12factor' 41end 42
git上のリポジトリのURL
クローンしたアプリケーションのURLはこちらになります。
回答2件
あなたの回答
tips
プレビュー