2013-04-12 70 views
1

我创建了一个非常简单的博客应用程序,其中有两个条目,我试图做的是将其推送到heroku,但出现以下错误:无法连接到数据库 - 无法将PostgreSQL数据库推送到heroku

$ heroku db:push [[email protected]:appname/blog.git] 
Loaded Taps v0.3.24 
Auto-detected local database: postgres://[email protected]/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 

但我已经安装了pg gem并安装了续集gem。这是我的gemfile。我排除了几行,因为它们被注释掉了。有没有人遇到过这个问题?

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' 
+0

水龙头是不是Heroku的推荐的方式了,你有没有尝试:https://devcenter.heroku.com/articles/heroku-postgres-import-export – pjam

+0

嗯...我会阅读教程并试一试。谢谢 – RubyDude1012

+0

好吧,让我知道如果你有任何问题,然后 – pjam

回答

2

我与db:pull有同样的问题。在确认我已安装好所有宝石之后,它可以正常工作(帽子提示:heroku db:pull not working)。

gem install pg heroku taps sequel