capistrano错误消息:请安装pg适配器:`gem install activerecord-pg-adapter`(无法加载此类文件 -

时间:2013-03-23 02:07:50

标签: ruby-on-rails rvm capistrano bundler

我正在使用capistrano并收到此错误消息:

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

我已从我的Gemfile和bundle install d中移除了宝石'pg'。我在Gemfile.lock中没有看到pg gem。我还将生产数据库更改为sqlite3适配器。为什么Rails 3.2 / Capistrano / Bundler要求这个?我没有使用它,而不是在Gemfile.lock中,我该如何解决它?我正在服务器上使用ubuntu 12.04。

事先提前

另外,当我按照它告诉我的运行时,我得到:

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

**编辑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

这是github上的database.yml文件的屏幕截图:

enter image description here

1 个答案:

答案 0 :(得分:9)

检查database.yml。当Postgres的正确适配器为pg-adapter时,您可能在其中有一个名为postgresql的条目。如果您删除或替换它,这应该有用。