質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Q&A

0回答

282閲覧

git push heroku master できない

koikoikoikoi

総合スコア14

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

0グッド

0クリップ

投稿2022/09/22 09:02

前提

railsチュートリアルを進めています
cloud9で git push heroku master コマンドを実行しようとするとエラーになってしまいます。

実現したいこと

git push heroku master を実行する

発生している問題・エラーメッセージ

$ git push heroku master Counting objects: 107, done. Compressing objects: 100% (89/89), done. Writing objects: 100% (107/107), 53.10 KiB | 1.90 MiB/s, done. Total 107 (delta 7), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-22 stack remote: -----> Determining which buildpack to use for this app 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: -----> Using Ruby version: ruby-3.1.2 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: Fetching gem metadata from https://rubygems.org/.......... remote: Fetching rake 12.3.3 remote: Installing rake 12.3.3 remote: Fetching concurrent-ruby 1.1.10 remote: Fetching minitest 5.16.3 remote: Fetching zeitwerk 2.6.0 remote: Fetching thread_safe 0.3.6 remote: Installing minitest 5.16.3 remote: Installing zeitwerk 2.6.0 remote: Installing concurrent-ruby 1.1.10 ※字数制限の為省略 remote: Fetching sass-listen 4.0.0 remote: Installing sass-listen 4.0.0 remote: Fetching sass 3.7.4 remote: Installing sass 3.7.4 remote: Fetching sass-rails 5.1.0 remote: Installing sass-rails 5.1.0 remote: Installing actionmailer 6.0.4 remote: Fetching rails 6.0.4 remote: Installing rails 6.0.4 remote: Bundle complete! 18 Gemfile dependencies, 59 gems now installed. remote: Gems in the groups 'development' and 'test' were not installed. remote: Bundled gems are installed into `./vendor/bundle` remote: Post-install message from sass: remote: remote: Ruby Sass has reached end-of-life and should no longer be used. remote: remote: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new remote: primary implementation: https://sass-lang.com/install remote: remote: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the remote: sassc gem: https://github.com/sass/sassc-ruby#readme remote: remote: * For more details, please refer to the Sass blog: remote: https://sass-lang.com/blog/posts/7828841 remote: remote: Bundle completed (81.79s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v16.13.1-linux-x64 remote: -----> Installing yarn-v1.22.17 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: 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. remote: rake aborted! remote: Psych::BadAlias: Unknown alias: default remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:30:in `available_environments' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:21:in `current' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:15:in `inquire' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/env.rb:7:in `inquire' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/instance.rb:11:in `env' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/instance.rb:18:in `config' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker.rb:26:in `config' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:32:in `block in <class:Engine>' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:32:in `instance_exec' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:32:in `run' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:61:in `block in run_initializers' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/initializable.rb:60:in `run_initializers' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/application.rb:363:in `initialize!' remote: /tmp/build_0082593b/config/environment.rb:5:in `<main>' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.4/lib/active_support/dependencies.rb:324:in `block in require' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.4/lib/active_support/dependencies.rb:291:in `load_dependency' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.4/lib/active_support/dependencies.rb:324:in `require' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/application.rb:339:in `require_environment!' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/railties-6.0.4/lib/rails/application.rb:523:in `block in run_tasks_blocks' remote: /tmp/build_0082593b/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in `block (2 levels) in define' remote: Tasks: TOP => environment remote: (See full trace by running task with --trace) remote: remote: ! remote: ! Precompiling assets failed. remote: ! 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: 127e0ffd899e2547ffe347533363be32a506951b remote: ! remote: ! We have detected that you have triggered a build from source code with version 127e0ffd899e2547ffe347533363be32a506951b 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 fathomless-shore-68344. remote: To https://git.heroku.com/fathomless-shore-68344.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/fathomless-shore-68344.git'

該当のソースコード

ソースコード

試したこと

psych::badalias: unknown alias: default のエラーが原因だと思ったので検索し、以下のアプローチを試しました。
①gemfileに gem 'psych', '~> 3.1' を追加 →  bundle install コマンド実行
②rails 6.1.4以降 で解決できるとのことなのでgemfileのrailsを rails 6.1.4 に変更

補足情報(FW/ツールのバージョンなど)

https://qiita.com/kandalog/items/8fd20f79ecf73034795a
https://zenn.dev/takuty/articles/eadd7eba7a54f0

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2022/09/23 06:04

remote: Running: rake assets:precompile とあるのでrails assets:precompileを試してみてはどうでしょうか?
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問