简体   繁体   English

无法连接到数据库 - 无法将PostgreSQL数据库推送到heroku

[英]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,但是我收到以下错误:

$ 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. 但是我已经安装了pg gem并安装了续集gem。 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. 我遇到了与db:pull相同的问题。 After making sure I had all the gems installed, it worked (with a hat tip to: heroku db:pull not working ). 在确定我安装了所有宝石之后,它工作了(用帽子提示: heroku db:拉不工作 )。

gem install pg heroku taps sequel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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