如何处理 Ruby on Rails 错误:“请安装 postgresql 适配器:`gem install activerecord-postgresql-adapter'" [英] How to handle Ruby on Rails error: "Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'"

查看:22
本文介绍了如何处理 Ruby on Rails 错误:“请安装 postgresql 适配器:`gem install activerecord-postgresql-adapter'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行使用 ActiveRecord 框架的 Ruby on Rails (RoR) 应用程序或 Ruby 代码,您会收到错误消息:

Running a Ruby on Rails (RoR) app or Ruby code which uses the ActiveRecord framework, you get the error message:

请安装 postgresql 适配器:gem 安装activerecord-postgresql-adapter

Please install the postgresql adapter: gem install activerecord-postgresql-adapter

尝试运行:

gem install activerecord-postgresql-adapter

也失败了,让你不知所措.

also fails, leaving you at a loss.

推荐答案

问题不在于有人写了什么.问题是 postgresql 数据库适配器的名称是postgresql",而不是postgres",尽管 GEM 的名称是pg".

The problem is not what anyone wrote. The problem is that the name of the postgresql database adapter is "postgresql", not "postgres", though the name of the GEM is "pg".

database.yml 文件中的定义应该包括

The definition in the database.yml file should include

  adapter: postgresql

这篇关于如何处理 Ruby on Rails 错误:“请安装 postgresql 适配器:`gem install activerecord-postgresql-adapter'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆