Samy Dindane
Samy Dindane

Reputation: 18716

"pg is not part of the bundle. Add it to Gemfile" when not using Postgres

Here's my problem:

I reinstalled Rails, reinstalled Ruby, used another Ruby version, reinstalled RVM... And keep getting the same error.

There is nothing related to PostgreSQL, postgres, pg or pql in my code. Not a single word.

I don't want to do what the exception suggests. I want to understand why I have this error and fix it.

So: Why is Rails asking me to install some Postgres stuff while I don't use Postgres?

Thanks!

Upvotes: 1

Views: 6308

Answers (1)

Samy Dindane
Samy Dindane

Reputation: 18716

The problem was the DATABASE_URL environment variable.
When ActiveRecord finds $DATABASE_URL, it automatically uses its information, and ignores config/database.yml.

Thanks to NARKOZ for pointing this out.

(By the way, I had this environment variable set before I discover foreman, which is a great tool to manage environment variables)

Upvotes: 8

Related Questions