本文介绍了capistrano错误消息:请安装pg适配器:`gem install activerecord-pg-adapter`(无法加载此类文件-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using capistrano and get this error message:

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

我已经删除了gem' pg(来自我的Gemfile和捆绑安装 d)。我的Gemfile.lock中没有pg宝石。我也将生产数据库更改为sqlite3适配器。为什么Rails 3.2 / Capistrano / Bundler要求这样做?我没有使用它,也没有在Gemfile.lock中使用它,该如何解决?我在正在发生这种情况的服务器上使用ubuntu 12.04。

I have removed the gem 'pg' from my Gemfile and bundle installd . I don't see the pg gem in my Gemfile.lock. I have also changed my production db to a sqlite3 adapter. Why is Rails 3.2 / Capistrano / Bundler asking for this? I'm not using it and not in Gemfile.lock and how do I resolve it? I am using ubuntu 12.04 on server that this is happening on.

thx

另外,当我运行它告诉我要运行的内容时,我得到了:

Also, when I run what it tells me to run, I get:

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

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文件的屏幕截图:

here's a screenshot of the database.yml file on github:

推荐答案

检查您的数据库.yml 。当Postgres的正确适配器是 postgresql 时,您可能会在其中输入一个名为 pg-adapter 的条目。如果您删除或替换了它,那应该可以。

Check your database.yml. You probably have an entry in it called pg-adapter, when the correct adapter for Postgres is postgresql. If you remove or replace that, this should work.

这篇关于capistrano错误消息:请安装pg适配器:`gem install activerecord-pg-adapter`(无法加载此类文件-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 09:52