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

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

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

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

Ruby on Rails

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

Q&A

解決済

1回答

1423閲覧

git push heroku master したい がエラーが出てしまう。

takataka3

総合スコア23

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2022/07/10 06:52

herokuにてデプロイ作業中にエラーが出てしまい解決できないのでご教授いただけると幸いです。

【現状】
heroku deploページにある以下の手順で作業を進めておりました。

Deploy using Heroku Git Use git in the command line or a GUI tool to deploy this app. Install the Heroku CLI Download and install the Heroku CLI. If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key. $ heroku login Create a new Git repository Initialize a git repository in a new or existing directory $ cd my-project/ $ git init $ heroku git:remote -a tim-leaf-84051 Deploy your application Commit your code to the repository and deploy it to Heroku using Git. $ git add . $ git commit -am "make it better" $ git push heroku master You can now change your main deploy branch from "master" to "main" for both manual and automatic deploys, please follow the instructions here. Existing Git repository For existing repositories, simply add the heroku remote $ heroku git:remote -a tim-leaf-84051

heroku git:remote -a tim-leaf-84051までは問題なく進みましたが
git add .

taka@masterMacBook-Air freemarket_sample_67e % git add . error: open(".bashrc.save"): Permission denied error: unable to index file '.bashrc.save' fatal: adding files failed taka@masterMacBook-Air freemarke

となります。
当然このまま進めてエラーとなってしまうのですが勉強不足で原因がわかりません。

taka@masterMacBook-Air freemarket_sample_67e % git commit -am "make it better" [master c0d0d55] make it better 1 file changed, 4 insertions(+)
Enumerating objects: 4626, done. Counting objects: 100% (4626/4626), done. Delta compression using up to 4 threads Compressing objects: 100% (3782/3782), done. Writing objects: 100% (4626/4626), 6.67 MiB | 419.00 KiB/s, done. Total 4626 (delta 2051), reused 2440 (delta 527) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 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 2.3.10 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.7.3 remote: -----> Installing dependencies using bundler 2.3.10 remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 remote: Fetching gem metadata from https://rubygems.org/......... 〜〜中略〜〜 remote: Bundle completed (55.70s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v16.13.1-linux-x64 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: /tmp/build_fe405a08/vendor/ruby-2.7.3/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError remote: /tmp/build_fe405a08/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.3/lib/net/protocol.rb:68: warning: previous definition of ProtocRetryError was here remote: /tmp/build_fe405a08/vendor/ruby-2.7.3/lib/ruby/2.7.0/net/protocol.rb:206: warning: already initialized constant Net::BufferedIO::BUFSIZE remote: /tmp/build_fe405a08/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.3/lib/net/protocol.rb:208: warning: previous definition of BUFSIZE was here remote: /tmp/build_fe405a08/vendor/ruby-2.7.3/lib/ruby/2.7.0/net/protocol.rb:503: warning: already initialized constant Net::NetPrivate::Socket remote: /tmp/build_fe405a08/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.3/lib/net/protocol.rb:504: warning: previous definition of Socket was here remote: Missing encryption key to decrypt file with. Ask your team for your master key and write it to /tmp/build_fe405a08/config/master.key or put it in the ENV['RAILS_MASTER_KEY']. remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to tim-leaf-84051. remote: To https://git.heroku.com/tim-leaf-84051.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/tim-leaf-84051.git'

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

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

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

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

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

guest

回答1

0

自己解決

解決しました!
ブランチが複数作成されていたことが原因でした。
https://teratail.com/questions/54791
こちら記事参考に不要なブランチを作成し、繋ぎ直したところうまくいきました。

その後、master.keyの入力漏れでbuild failedになりましたが
https://qiita.com/koki_73/items/df7b4b001943e3ed69e7
こちらの記事参考にmaster.key設定で無事完了することができました・

投稿2022/07/12 14:21

takataka3

総合スコア23

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問