Postgresql PG:错误:关系“;管理员“用户”;不存在
在尝试登录到我的产品URL的管理员/登录部分后,当我运行heroku日志时,当前出现以下错误:Postgresql PG:错误:关系“;管理员“用户”;不存在,postgresql,heroku,ruby-on-rails-4,activeadmin,Postgresql,Heroku,Ruby On Rails 4,Activeadmin,在尝试登录到我的产品URL的管理员/登录部分后,当我运行heroku日志时,当前出现以下错误: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation “admin_users" does not exist 我尝试过遵循以下思路:,即特别是以下建议步骤(建议在“新安装”上执行,我不清楚这意味着什么!) rails g active_管理员:设计 rails g active_管理员:安装 (如果由于#2414
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation “admin_users" does not exist
我尝试过遵循以下思路:,即特别是以下建议步骤(建议在“新安装”上执行,我不清楚这意味着什么!)
数据库.yml
文件的副本:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: postgresql
database: myapp_development
pool: 5
timeout: 5000
password:
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
database: myapp_test
pool: 5
timeout: 5000
password:
production:
adapter: postgresql
database: myapp_production
username:
password:
pool: 5
timeout: 5000
这是我的档案副本
source 'https://rubygems.org'
ruby "2.1.1"
gem 'rails', '4.0.4'
gem 'sass-rails', '~> 4.0.2'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
gem 'activeadmin', github: 'gregbell/active_admin'
group :production do
gem 'pg'
gem 'rails_12factor'
end
通过
git
将代码推送到Heroku后,切换到项目根目录并运行:
$ heroku run rake db:migrate
这将在生产服务器上运行
rake db:migrate
。通过git
将代码推送到Heroku后,切换到项目根目录并运行:
$ heroku run rake db:migrate
这将在生产服务器上运行
rake db:migrate
。通过git
将代码推送到Heroku后,切换到项目根目录并运行:
$ heroku run rake db:migrate
这将在生产服务器上运行
rake db:migrate
。通过git
将代码推送到Heroku后,切换到项目根目录并运行:
$ heroku run rake db:migrate
这将在您的生产服务器上运行
rake db:migrate
。当我运行heroku run rake db:create
时,我收到以下错误:致命:数据库“postgres”的权限被拒绝详细信息:用户没有连接权限。
@Thalatta我的错误。您不能在Heroku上运行db:create
或db:drop
。db:migrate
是否为您创建了正确的表?尚不清楚。如何查看创建了哪些表?它只显示:1运行rake db:migrate
连接到终端。。。向上运行.2915`将PostgreSQL添加到路径中。这很可能是你所有问题的核心。完成后重新启动您的终端,以确保您可以成功地在哪里使用psql
。我个人使用~/.bash\u profile
。添加PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH;出口路径
到文件末尾。当我运行heroku run rake db:create
时,我得到以下错误:致命:对数据库“postgres”的权限被拒绝详细信息:用户没有连接权限。
@thalata我的错误。您不能在Heroku上运行db:create
或db:drop
。db:migrate
是否为您创建了正确的表?尚不清楚。如何查看创建了哪些表?它只显示:1运行rake db:migrate
连接到终端。。。向上运行.2915`将PostgreSQL添加到路径中。这很可能是你所有问题的核心。完成后重新启动您的终端,以确保您可以成功地在哪里使用psql
。我个人使用~/.bash\u profile
。添加PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH;出口路径
到文件末尾。当我运行heroku run rake db:create
时,我得到以下错误:致命:对数据库“postgres”的权限被拒绝详细信息:用户没有连接权限。
@thalata我的错误。您不能在Heroku上运行db:create
或db:drop
。db:migrate
是否为您创建了正确的表?尚不清楚。如何查看创建了哪些表?它只显示:1运行rake db:migrate
连接到终端。。。向上运行.2915`将PostgreSQL添加到路径中。这很可能是你所有问题的核心。完成后重新启动您的终端,以确保您可以成功地在哪里使用psql
。我个人使用~/.bash\u profile
。添加PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH;出口路径
到文件末尾。当我运行heroku run rake db:create
时,我得到以下错误:致命:对数据库“postgres”的权限被拒绝详细信息:用户没有连接权限。
@thalata我的错误。您不能在Heroku上运行db:create
或db:drop
。db:migrate
是否为您创建了正确的表?尚不清楚。如何查看创建了哪些表?它只显示:1运行rake db:migrate
连接到终端。。。向上运行.2915`将PostgreSQL添加到路径中。这很可能是你所有问题的核心。完成后重新启动您的终端,以确保您可以成功地在哪里使用psql
。我个人使用~/.bash\u profile
。添加PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH;出口路径代码>到文件末尾。