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

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

问题描述

运行的Ruby on Rails(RoR的)应用程序或Ruby code,它使用的ActiveRecord的框架,你会得到错误信息:

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

请安装PostgreSQL的适配器:   创业板安装   ActiveRecord的-PostgreSQL的适配器

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的,虽然创业板的名称为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的适配器:`安装了activerecord-PostgreSQL的适配器“"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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