- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Azure 上部署 Web 应用程序(通过 Linux 虚拟机)后,我成功访问主页(首页),但在尝试登录(导航栏右上角)时收到此错误:
我查了一下这个问题,发现其他人也有这个问题。他们通过重置和迁移解决了这个问题,但不起作用。到目前为止我已经尝试过:
以下命令可以正确执行,但不能解决问题:
RAILS_ENV=生产 rake db:drop db:create db:migrate
注释掉user.rb文件但并没有解决问题
我认为该错误是由于 gem devise
或 gem rails_admin
引起的,但我无法找到解决方案。
gem 文件:
source 'https://rubygems.org'
ruby '2.6.0'
gem 'grape'
gem 'bootsnap', require: false
gem 'devise'
gem 'jbuilder', '~> 2.0'
gem 'pg', '~> 0.21'
gem 'puma'
gem 'rails', '5.2.2'
gem 'redis'
gem "mini_magick"
gem "chartkick"
gem 'country-select'
gem 'rails_admin', '~> 1.3'
gem 'activestorage-validator'
gem 'rubyzip', '>= 1.2.1'
gem 'axlsx', git: 'https://github.com/randym/axlsx.git', ref: 'c8ac844'
gem 'axlsx_rails'
gem 'autoprefixer-rails'
gem 'bootstrap-sass', '~> 3.3'
gem 'font-awesome-sass', '~> 5.5.0'
gem 'sassc-rails'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
group :development do
gem 'web-console', '>= 3.3.0'
end
group :development, :test do
gem 'pry-byebug'
gem 'pry-rails'
gem 'listen', '~> 3.0.5'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'dotenv-rails'
end
database.yml的内容:
default: &default
adapter: postgresql
encoding: utf-8
database: caoee
username: mat
password: ***
pool: 5
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
adapter: postgresql
encoding: utf-8
database: caoee
username: mat
password: ***
pool: 5
test:
<<: *default
adapter: postgresql
encoding: utf-8
database: caoee
username: mat
password: ***
pool: 5
production:
adapter: postgresql
encoding: utf-8
database: caoee
username: mat
password: ***
pool: 5
Postgresql 角色:
角色列表
Role name | Attributes | Member of
-----------------------------------
mat | Superuser, Create role, Create DB | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS|{}
最佳答案
您是否在本地运行该命令RAILS_ENV=product ...
?因为这只会使用生产设置在本地运行命令。
您需要重置 Azure 服务器上的数据库。我不熟悉 Azure CLI,但我确信有命令可以远程重置数据库。
关于ruby-on-rails - PG::UndefinedTable:错误:关系 "users"不存在 - Azure 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55464434/
我有以下命名空间模型: # app/models/face_data/pool_membership.rb class FaceData::PoolMembership 0 AND NOT a.at
我有一些模型设置了命名空间.. rails g model Technology::Post ... 这导致了错误 PG::UndefinedTable: ERROR: relation "post
我以前看到过这个问题,但只针对 rspec。我还没有创建测试,因为它对我来说太先进了,但总有一天我会的! :P 当我尝试注册/登录我的应用程序时出现此错误。我使用 devise 创建用户,还使用
只是尝试构建一个 Rails 应用程序,我很确定我做了一些愚蠢的事情。我跑了一个脚手架,拼错了模型 Ave vs Afe。我确定我已经完成并更改了迁移文件和查看文件等中的所有内容,甚至搜索了“ave”
我在开发和测试中使用 sqlite,并部署到在生产中使用 Postgres 的 Heroku。我通过在终端中运行以下命令为“评论”创建了一个新模型: rails g model Review comm
我遇到了一个问题,我不确定如何解决这个问题。在创建 Rails View 、填充 View 和编辑 Controller 后,我遇到了一个错误,指出 PG::UndefinedTable: ERROR
我有模型 class Offer { where(state: 'active') } # Somewhere else merge(Agency.active) 此外,了解其他模型的表名是什么。在
我刚刚向模型添加了全局化(使用 globalize gem)。 模型: class Information::Blog::Post t.typcollation WHE
我有一个表 A,其中包含列 name(string)、email(sring) 和 details(json)。我想像这样使用 first_or_create: A.where(:name => a.
作为我看到的表格的一部分: ... ... 处理表单提交的邀请 Controller 方法: def create @user = User.find(email: para
我知道这个问题已经被问过很多次了,但我已经尝试了很多解决方案,但都没有成功。我在 Heroku 上部署了一个 Rails 应用程序,它可以在本地运行,但我收到“很抱歉,出了点问题”。当我尝试在 Her
将应用程序 Rails 5.2 更新为 6,更新添加了以下两个迁移: # This migration comes from active_storage (originally 201901
我有两个模型:Courier 和 Order。 我有以下查询: active_couriers = Courier. available_courier_status. where(:serv
我在开发环境中使用 SQlite,在生产环境中使用 Postgre。 在开发过程中一切正常。但是当我尝试重置和迁移生产数据库时,我收到了以下消息: PG::UndefinedTable: ERROR:
因此,我正在开发一个现有的应用程序,并且正在将其设置到我的本地环境中,但是我遇到了一些问题: 1. 我已经下载了最新的代码,并从内部开发人员那里转储了数据库。这是一个 .sql 文件,所以我使用了以下
例如,如果我尝试删除一个不存在的表,我将收到以下错误: "# ex if ex.cause.is_a?(PG::UndefinedTable) # do something else
在迁移时,我收到以下错误消息: PG::UndefinedTable: ERROR: relation "actioncodes" does not exist : ALTER TABLE "org
我在事件和用户之间有一个 has_and_belongs_to_many 关系。 用户.rb class User 0 AND NOT a.attisdropped O
我的一个 PG DB 表出现了这个问题。我有一个表,它的名字是“hproducts_rules”。这应该与“hproducts_matchs”表具有“belongs_to”关系。 这是我的表架构: h
rake db:migrate 在 sqlite3 中本地工作,但在 heroku 中的 postgresql 中不起作用。 错误 PG::UndefinedTable: ERROR: relati
我是一名优秀的程序员,十分优秀!