简体   繁体   中英

Failed to connect to database - can't push PostgreSQL database to heroku

I created a very simple blog app with a couple of entries and all I'm trying to do is push it to heroku, but I get the following error:

$ heroku db:push [git@github.com:appname/blog.git]
Loaded Taps v0.3.24
Auto-detected local database: postgres://benjaminw@127.0.0.1/blog_development?en
coding=WIN1252
Warning: Data in the app 'afternoon-taiga-2755' will be overwritten and will not
be recoverable.

!    WARNING: Destructive Action
!    This command will affect the app: afternoon-taiga-2755
!    To proceed, type "afternoon-taiga-2755" or re-run this command with --conf
irm afternoon-taiga-2755

> afternoon-taiga-2755
Failed to connect to database:
Sequel::AdapterNotFound -> LoadError: cannot load such file -- pg

But I've got the pg gem installed and the sequel gem installed. Here is my gemfile. I've excluded a few lines because they were commented out. Has anyone ran into this problem?

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

 gem 'pg'
 gem 'activerecord-postgresql-adapter'
 gem 'sequel'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

I was having the same issue with db:pull. After making sure I had all the gems installed, it worked (with a hat tip to: heroku db:pull not working ).

gem install pg heroku taps sequel

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