Rails:拒绝关系schema_migrations的权限 [英] Rails: permission denied for relation schema_migrations

查看:92
本文介绍了Rails:拒绝关系schema_migrations的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Ruby on Rails网络应用程序设置本地生产环境。我可以使用 rails server 命令运行该应用程序,该命令提供了开发环境。

I'm trying to setup a local production environment for a Ruby on Rails web application. I can run the application with rails server command, which gives the development environment.

我正在使用生产环境尝试设置纯粹是本地的,我已经按照本教程使用apache 2进行了设置: https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with- apache-and-passenger-on-centos-6

The production environment I'm trying to set up is purely local and I've followed this tutorial for setting it up with apache 2: https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with-apache-and-passenger-on-centos-6

但是,当我进入应用程序页面时,出现以下错误:

However when I go to the page of my application I get the following error:

PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations : SELECT "schema_migrations".* FROM "schema_migrations"

在我的数据库中。yml我具有用于开发和生产的以下设置:

in my database.yml I have these settings for development and production:

adapter: postgresql
database: whiteboard
username:
password:
pool: 5
timeout: 5000

无论如何我都不可以更改这些设置。

I'm not allowed to change these settings, no matter what.

有什么办法可以解决此问题? (如果是,请分步进行操作)

Is there any way to fix this? (if yes, step by step please)

推荐答案

似乎您必须在数据库上创建一个具有所有所需特权的数据库用户。
例如,我认为您可以通过登录数据库控制台来完成操作,然后执行以下操作:

It seems you have to create a DB user with all needed privileges on your DB. For example I think you could do the trick by log in your DB console then do something like:

CREATE USER your_new_username WITH PASSWORD 'your_new_password';
CREATE DATABASE whiteboard;
GRANT ALL PRIVILEGES ON DATABASE whiteboard to your_new_username;
ALTER DATABASE whiteboard OWNER TO your_new_username;

然后更新您 database.yml

adapter: postgresql
database: whiteboard
username: your_new_username
password: your_new_password
pool: 5
timeout: 5000

希望它会有所帮助!

这篇关于Rails:拒绝关系schema_migrations的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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