Railsチュートリアル 第1章にて、 Herokuへのデプロイでエラーが出て、デプロイができません。

前提

Railsチュートリアル 第1章にて、チュートリアル通りに進めましたが、Herokuへのデプロイでエラーが出て、デプロイができません。

Cloud9でgit push heroku mainを実行すると、下記のエラーが出ます。

実現したいこと

Herokuへデプロイしたい。

発生している問題・エラーメッセージ(HerokuのBuildlogの内容です。Cloud9側のエラー表示も同じだと思います)。

Overview Resources Deploy Metrics Activity Access Settings
Activity Feed Build LogID 41a25b49-d5df-498a-a867-e7127150a333
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
Detected buildpacks: Ruby,Node.js
See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
-----> Ruby app detected
-----> Installing bundler 2.3.10
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.3.10
Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
Fetching gem metadata from https://rubygems.org/..........
Fetching rake 12.3.3
Installing rake 12.3.3
Fetching minitest 5.16.2
Fetching zeitwerk 2.6.0
Fetching thread_safe 0.3.6
Fetching concurrent-ruby 1.1.10
Installing minitest 5.16.2
Installing thread_safe 0.3.6
Installing zeitwerk 2.6.0
Installing concurrent-ruby 1.1.10
Fetching builder 3.2.4
Fetching erubi 1.10.0
Installing builder 3.2.4
Using racc 1.6.0
Fetching crass 1.0.6
Installing erubi 1.10.0
Fetching rack 2.2.4
Fetching nio4r 2.5.8
Installing crass 1.0.6
Installing rack 2.2.4
Fetching websocket-extensions 0.1.5
Installing nio4r 2.5.8 with native extensions
Fetching marcel 1.0.2
Installing websocket-extensions 0.1.5
Fetching mini_mime 1.1.2
Installing marcel 1.0.2
Installing mini_mime 1.1.2
Fetching msgpack 1.5.4
Using bundler 2.3.10
Fetching ffi 1.15.5
Installing msgpack 1.5.4 with native extensions
Fetching method_source 1.0.0
Installing method_source 1.0.0
Fetching pg 1.1.4
Installing ffi 1.15.5 with native extensions
Installing pg 1.1.4 with native extensions
Fetching thor 1.2.1
Installing thor 1.2.1
Fetching rb-fsevent 0.11.1
Installing rb-fsevent 0.11.1
Fetching tilt 2.0.11
Installing tilt 2.0.11
Fetching turbolinks-source 5.2.0
Installing turbolinks-source 5.2.0
Fetching tzinfo 1.2.10
Installing tzinfo 1.2.10
Fetching nokogiri 1.13.8 (x86_64-linux)
Installing nokogiri 1.13.8 (x86_64-linux)
Fetching i18n 1.12.0
Installing i18n 1.12.0
Fetching websocket-driver 0.7.5
Installing websocket-driver 0.7.5 with native extensions
Fetching rack-test 2.0.2
Installing rack-test 2.0.2
Fetching rack-proxy 0.7.2
Installing rack-proxy 0.7.2
Fetching sprockets 3.7.2
Installing sprockets 3.7.2
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching puma 4.3.6
Installing puma 4.3.6 with native extensions
Fetching turbolinks 5.2.0
Installing turbolinks 5.2.0
Fetching loofah 2.18.0
Installing loofah 2.18.0
Fetching activesupport 6.0.4
Installing activesupport 6.0.4
Fetching bootsnap 1.10.3
Installing bootsnap 1.10.3 with native extensions
Fetching rails-html-sanitizer 1.4.3
Installing rails-html-sanitizer 1.4.3
Fetching rails-dom-testing 2.0.3
Installing rails-dom-testing 2.0.3
Fetching globalid 1.0.0
Installing globalid 1.0.0
Fetching activemodel 6.0.4
Installing activemodel 6.0.4
Fetching jbuilder 2.9.1
Installing jbuilder 2.9.1
Fetching actionview 6.0.4
Installing actionview 6.0.4
Fetching activejob 6.0.4
Installing activejob 6.0.4
Fetching activerecord 6.0.4
Installing activerecord 6.0.4
Fetching actionpack 6.0.4
Installing actionpack 6.0.4
Fetching actioncable 6.0.4
Installing actioncable 6.0.4
Fetching activestorage 6.0.4
Installing activestorage 6.0.4
Fetching actionmailer 6.0.4
Installing actionmailer 6.0.4
Fetching railties 6.0.4
Installing railties 6.0.4
Fetching sprockets-rails 3.4.2
Installing sprockets-rails 3.4.2
Fetching actionmailbox 6.0.4
Installing actionmailbox 6.0.4
Fetching actiontext 6.0.4
Installing actiontext 6.0.4
Fetching webpacker 4.0.7
Installing webpacker 4.0.7
Fetching rails 6.0.4
Installing rails 6.0.4
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.7.4
Installing sass 3.7.4
Fetching sass-rails 5.1.0
Installing sass-rails 5.1.0
Bundle complete! 18 Gemfile dependencies, 58 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into ./vendor/bundle
Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used. * If you use Sass as a command-line tool, we recommend using Dart Sass, the new primary implementation: https://sass-lang.com/install * If you use Sass as a plug-in for a Ruby web framework, we recommend using the sassc gem: https://github.com/sass/sassc-ruby#readme * For more details, please refer to the Sass blog: https://sass-lang.com/blog/posts/7828841 Bundle completed (23.33s) Cleaning up the bundler cache.

-----> Installing node-v16.13.1-linux-x64
-----> Installing yarn-v1.22.17
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Rails couldn't infer whether you are using multiple databases from your database.yml and can't generate the tasks for the non-primary databases. If you'd like to use this feature, please simplify your ERB.
rake aborted!
Psych::BadAlias: Unknown alias: default
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:30:in available_environments' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:21:in current'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:15:in inquire' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:7:in inquire'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/instance.rb:11:in env' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/instance.rb:18:in config'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker.rb:26:in config' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:32:in block in class:Engine'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:32:in instance_exec' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:32:in run'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:61:in block in run_initializers' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:60:in run_initializers'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/application.rb:363:in initialize!' /tmp/build_4bbf9938/config/environment.rb:5:in <main>'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in require' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.4/lib/active_support/dependencies.rb:324:in block in require'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.4/lib/active_support/dependencies.rb:291:in load_dependency' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.4/lib/active_support/dependencies.rb:324:in require'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/application.rb:339:in require_environment!' /tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/application.rb:523:in block in run_tasks_blocks'
/tmp/build_4bbf9938/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed

### 試したこと app(hello_app)を削除し、GitHubとHerokuのレポジトリを削除して、最初からチュートリアルをやり直しました。それでも同じエラーが出るので、IAMのユーザーも作り直して、GitHubとHerokuのレポジトリを削除を削除して、最初からチュートリアルをやり直しました。 ### 補足情報(FW/ツールのバージョンなど) 基本的にチュートリアル通りにやっていますが、ブランチ名はHerokuの指示に従って、masterからmainへと書き直しています。

コメントを投稿

0 コメント