简体   繁体   中英

Heroku error: Please install the postgresql adapter but I'm using mysql, so why am I seeing this error?

Please install the postgresql adapter: gem install activerecord-postgresql-adapter (pg is not part of the bundle. Add it to Gemfile.)

So I followed the instructions here: How to handle Ruby on Rails error: "Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'"

First of all, that doesn't fix my issue (causes other errors that I'd need to debug), but regardless, why should I have to install the PG interface for ruby exactly? I'm on mysql!

Edit: I've been told Heroku doesn't support MySQL. Was this a recent change? I was using mysql just about 3 months back for my Heroku site without any issues at all.

I don't want to presume anything but if you were able to work with heroku before, you probably had something like this in your Gemfile:

group :production do
  gem 'pg'
....
end

group :development do
  gem 'rspec-rails'
  gem 'sqlite3'

....
end

This would ensure that rails is using mysql (or sqlite3 if you copy the example verbatim) in the development environment and postgres ('pg') on the production environment hosted by heroku. Give this a shot and see if it solves your problem. I hope it does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM