現在、Ruby on Rails にてポートフォリオを作成中です。
https://qiita.com/kazukimatsumoto/items/a0daa7281a3948701c39
現在、この記事を参考にしながらherokuへのデプロイを試みています。
git push heroku masterをmacターミナル上で入力したところ、
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 damp-mountain-33769. remote: To https://git.heroku.com/damp-mountain-33769.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/damp-mountain-33769.git'
このようなエラー文が出ます。
```remote: Running: rake assets:precompile remote: rake aborted! remote: ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `rails credentials:edit` ``` ~~とあったため、”rails credentials:edit”を実行~~ ↓ ``` No $EDITOR to open file in. Assign one like this: EDITOR="mate --wait" bin/rails credentials:edit For editors that fork and exit immediately, it's important to pass a wait flag, otherwise the credentials will be saved immediately with no chance to edit. ``` ~~と出る。そして”EDITOR=Atom rails credentials:edit”と入力~~ ↓ ``` File encrypted and saved. ``` ~~と出る。もう一度”git push heroku master"を入力~~ ↓ ~~同じエラーが出る~~。 **追記事項(2020-03-06)** 斜線で消した部分は、最初からやり直したところエラーとして出てこなくなったのですが、remote: ! Precompiling assets failed.部分の赤文字エラーは変わらず、、 今度は、 ``` remote: Compiling... remote: Compilation failed: remote: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. remote: - configuration.entry should be an non-empty object. remote: -> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array. ``` というように、remote: ! Precompiling assets failed.の上部に出ております。 -以下、自分で試したこと- ・cssをsccsに変えてみた ・config/application.rbに「config.assets.initialize_on_precompile = false」を追加し、再度git push heroku master ・RAILS_ENV=development bin/rails assets:precompileを入力して開発環境内のエラーを確認(該当なし) ・RAILS_ENV=production bin/rails assets:precompileを入力し、本番環境内の異常を確認(該当なし) というような感じです。何かお分かりの方、アドバイスいただけると幸いです。また、herokuに触れて間もないので、補足が必要でしたらご指摘いただきたいです。 よろしくお願い致します。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。