Project

General

Profile

heroku run rake db:create fails with Could not find gem 'pg…, but the database is mysql2 (not postgresql)

Added by Carlos Garcia about 10 years ago

I receive the following error when I run heroku run rake db:create (bundle install finished correctly without errors):

Running 'rake db:create' attached to terminal... up, run.6027
Could not find gem 'pg (>= 0.11.0) ruby' in the gems available on this machine.
Run bundle install to install missing gems.

In the config/database.yml I'm using the default mysql2 database:

production:
adapter: mysql2
database: redmine
host: localhost
...
development:
adapter: mysql2
...
test:
adapter: mysql2
...

So I guess 'pg (>= 0.11.0) ruby' does not need to be installed. Am I wrong?

On the other hand, Gemfile has the following code:

adapters.each do |adapter|
case adapter
when 'mysql2'
gem "mysql2", "~> 0.3.11", :platforms => [:mri, :mingw]
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
...
when /postgresql/
gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
...

So again, I guess it should never enter in when /postgresql/ when the command heroku run rake db:create is executed. Am I right?

I'm using Windows XP. It is the first time I use Ruby.


    (1-1/1)