実現したいこと
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
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。