2013-04-12 250 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