capistrano error msg: Please install the pg adapter: `gem install activerecord-pg-adapter` (cannot load such file --

♀尐吖头ヾ 提交于 2019-12-22 17:10:17

问题


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)

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 in advance

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:~$ \

** edit 1 **

from root of app

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/15582618/capistrano-error-msg-please-install-the-pg-adapter-gem-install-activerecord-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!