Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修正 #14

Merged
merged 1 commit into from
Oct 1, 2021
Merged

修正 #14

merged 1 commit into from
Oct 1, 2021

Conversation

Tom-SAS
Copy link
Owner

@Tom-SAS Tom-SAS commented Oct 1, 2021

ところ以下のエラーが発生。

 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/icokkatest.git'

さらに上のログを見るとこんな記述も

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

試しにこちらのサイトへアクセスして以下のことを実行する。(やったことの順番は上から)

  • 全てのリポジトリがマスターブランチにコミットされていることを確認する。
matsudatomohiro@Toms-MacBook-Pro icokkatest % git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

nothing to commit, workingtree cleanはまだマスターに反映されていない変更があるので、それを反映させる必要がある。

git add -A

・webpackerに何かしらの問題があるのでは?何故なら precompileに失敗しているので。
そこで上に遡ってエラーメッセージを紐解く

[email protected]" has unmet peer dependency "webpack@^4.37.0

これについて調べた結果これを発見
rails/webpacker#1078
そしてこれを実行してみる

yarn add webpack

何やらこんな警告文も出ているので、これについて調べてみる。

Warning - The same version of this code has already been built:

するとこんな記事があったのでそれを試してみる
https://qiita.com/nto300002/items/54a3c8d96956cbdd7cf1

heroku logs

ログに記載されているURLへ飛ぶ

2021-10-01T22:31:24.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f496a726-dbe1-418f-b082-e162bc26eac0/activity/builds/32513098-df49-4b75-9003-ac3d19ae8dde

そこにこんな記載が

Building on the Heroku-18 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.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.6.5
-----> Installing dependencies using bundler 2.2.21

中身を見てもちょっと解読が難しいので、warning: Multipleの部分をコピペしてググる(しかし、このままではいけない。。。本当はこういった文章を紐解く理解力が必要なのに。。。)
https://qiita.com/haru52/items/c2e062f6e1c7d4ecfe49 
すると、こんな記事が。これによるとbundlerのバージョンに問題がある。とのこと。precompileに失敗しているので、bundlerのバージョンに問題がある可能性は否定できない。よってやってみる。

bundle -v
Bundler version 2.1.4

そこでちょっと思いとどまる。
本当にbundlerなのか?と。自分のエラーが他人のエラーと全く同じとは限らない。やはりドキュメントを紐解くことが正解への近道なのでは。となので、もう一度頑張ってグーグル翻訳を使いながら調べてみる。メッセージからこのページの内容に沿って実行
https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app 

heroku buildpacks:set heroku/ruby

再度読み解く
https://devcenter.heroku.com/articles/ruby-support#rails-6-x-applications 
これを実行してみる。

$ heroku buildpacks:add heroku/nodejs
$ heroku buildpacks:add heroku/ruby

@Tom-SAS Tom-SAS merged commit ab63128 into master Oct 1, 2021
@Tom-SAS Tom-SAS mentioned this pull request Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant