2013-03-23 97 views
2

我使用Capistrano的,並得到該錯誤消息:Capistrano的錯誤信息:請安裝PG適配器:`安裝了activerecord-PG-adapter`(無法加載這樣的文件 -

Please install the pg adapter: `gem install activerecord-pg-adapter` (cannot load such file -- active_record/connection_adapters/pg_adapter) 

我已刪除了gem'pg'從我的Gemfile和bundle install d。我沒有在Gemfile.lock中看到pg gem,我也將生產數據庫更改爲sqlite3適配器爲什麼Rails 3.2/Capistrano/Bundler要求這樣做?我沒有使用它,不在Gemfile.lock中,我如何解決它?我在服務器上使用Ubuntu 12.04發生這種情況。

thx預先

而且,當我運行它告訴我跑,我得到:

[email protected]:~$ gem install activerecord-pg-adapter 
ERROR: Could not find a valid gem 'activerecord-pg-adapter' (>= 0) in any repository 
^CERROR: Interrupted 
[email protected]:~$ \ 

**編輯** 1

從應用程序的根

Fri Mar 22$ grep -ri 'pg-adapter' * 
Fri Mar 22$ 

的database.yml

development: 
    adapter: sqlite3 
    database: db/development.sqlite3 
    pool: 5 
    timeout: 5000 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: sqlite3 
    database: db/test.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

這裏是database.yml文件的屏幕截圖github上:

enter image description here

回答

9

檢查database.yml。當Postgres的正確適配器是postgresql時,您可能在其中有一個名爲pg-adapter的條目。如果你刪除或替換,這應該工作。

+0

thx,我已經添加了我的database.yml並通過目錄樹完成了grep的結果。我很困惑。任何其他想法? thx再次 - 我知道我的東西愚蠢的東西 – timpone 2013-03-23 02:20:43

+0

你說這發生在部署過程中 - 是一個不同的'database.yml'在部署過程中複製到你的配置目錄? – Veraticus 2013-03-23 02:23:26

+0

嗯...我不這麼認爲。使用capistrano;我不知道如何不同的database.yml可以達到那裏。在github上檢查並且沒有在database.yml中引用pg。我懷疑你是對的,但我想這可能是怎麼回事。 Capistrano刪除了釋放;讓我看看我是否可以得到它不刪除版本 – timpone 2013-03-23 02:29:42

相關問題