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

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

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

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

Ruby on Rails

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

Q&A

解決済

1回答

1164閲覧

HerokuでRailsアプリをデプロイできません

hana00033

総合スコア17

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2019/06/15 12:06

実現したいこと

railsアプリをherokuを使ってデプロイしたい

発生している問題

プログラミング初心者です。

https://qiita.com/kazukimatsumoto/items/a0daa7281a3948701c39
この記事を参考にデプロイしようとしたら、git push heroku masterを実行したところで以下のエラーがでました。

remote: Compressing source files... done. remote: Building source: remote: 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: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.5.0 remote: remote: ###### WARNING: remote: remote: You have the `.bundle/config` file checked into your repository remote: It contains local state like the location of the installed bundle remote: as well as configured git local gems, and other settings that should remote: not be shared between multiple checkouts of a single repo. Please remote: remove the `.bundle/` folder from your repo and add it to your `.gitignore` file. remote: https://devcenter.heroku.com/articles/bundler-configuration remote: remote: -----> Installing dependencies using bundler 1.15.2 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. (省略) remote: remote: Bundle completed (40.60s) remote: Cleaning up the bundler cache. remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: The latest bundler is 2.0.2, but you are currently running 1.15.2. remote: To update, run `gem install bundler` remote: -----> Installing node-v10.14.1-linux-x64 remote: -----> Detecting rake tasks remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: rake aborted! remote: Gem::LoadError: Error loading the 'postgresql' Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile. (省略) remote: remote: Caused by: remote: Gem::LoadError: pg is not part of the bundle. Add it to your Gemfile. (省略) 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: Verifying deploy... remote: remote: ! Push rejected to namakemono3. remote: To https://git.heroku.com/namakemono3.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/namakemono3.git'

###試したこと
https://qiita.com/yutasuzuki0206/items/b359279e0105fea64d31
↑この記事を参考にconfig.assets.initialize_on_precompile = falseをconfig/application.rbに追加しても同じエラーが出てしまいます。

application.rbのソースコード↓

require_relative 'boot' require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module App class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.2 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. config.assets.initialize_on_precompile = false end end

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

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

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

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

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

guest

回答1

0

自己解決

自己解決しました、、、
なんかの拍子に勝手に.gitignoreを消してしまい、.bundle/configがherokuにアップロードされてしまったためでした、、、

https://qiita.com/jpmogul/items/b651d2664d6055cc6bf9
↑この記事を参考に一度gitのキャッシュを全て削除し.gitignoreを反映させたら無事にデプロイできました。

投稿2019/06/15 12:42

hana00033

総合スコア17

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問