gpt4 book ai didi

ruby-on-rails - Ruby on Rails - 无法加载 postgres 适配器

转载 作者:行者123 更新时间:2023-11-29 13:56:37 26 4
gpt4 key购买 nike

在 heroku 上(本地)构建一个 Rails 应用程序。按照他们的教程进行 rails , 和 installing postgres locally .

每当我运行服务器或生成迁移时,我都会收到以下错误:

LoadError (Could not load 'active_record/connection_adapters/posgtres_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile.):

数据库.yml:

default: &default
adapter: postgresql
encoding: unicode
pool: 5

development:
<<: *default
database: myapp_development
username: Name
password: secret
host: localhost

Gem 文件有:gem 'rails' '4.2.0' 和 gem 'pg' 安装

我机器的操作系统:Windows 64x

感谢任何帮助。

最佳答案

怀疑这是否与您遇到的问题相同,但是请发布这些详细信息以防它提供线索。我正在使用 Windows 10

我有同样的错误信息。为了排除故障,我尝试使用“gem install pg”重新安装 pg,但文件被锁定。

发现我有一个进程仍在使用其中一个 PG 文件并关闭该进程,删除了位于 C:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\pg-0.18 的整个 pg 目录.3-x64-mingw32

重新运行“gem install pg”rake db:setup、rake db:create、rake db:migrate,错误消失了。

关于ruby-on-rails - Ruby on Rails - 无法加载 postgres 适配器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30541687/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com