[Ruby] Error when bundle install

less than 1 minute read

Overview

This section describes the error that occurred when bundle install gem in Rails application and how to solve it.

environment

Ruby 2.6.5
Ruby on Rails 6.0.0

Contents

Error statement

An error occurred while installing pg (1.2.3), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.2.3' --source 'https://rubygems.org/'`
succeeds before bundling.

When

Could not find gem 'pg (>= 0.18, < 2.0)' in any of the gem sources listed in your Gemfile.

It is an error such as.

How to solve

It was solved by the following command.

brew install postgres

It seems that I was stuck in postgresQL.