Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql PG:错误:关系“;管理员“用户”;不存在_Postgresql_Heroku_Ruby On Rails 4_Activeadmin - Fatal编程技术网

Postgresql PG:错误:关系“;管理员“用户”;不存在

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

在尝试登录到我的产品URL的管理员/登录部分后,当我运行heroku日志时,当前出现以下错误:

ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation “admin_users"  does not exist
我尝试过遵循以下思路:,即特别是以下建议步骤(建议在“新安装”上执行,我不清楚这意味着什么!)

  • rails g active_管理员:设计

  • rails g active_管理员:安装

  • (如果由于#2414而导致安装失败,请从路由文件中删除重复的ActiveAdmin.routes(self),然后运行rails g active_admin:assets) 删除添加\设计\到\管理\用户迁移文件

  • rake数据库:迁移

    我已经完成了上面的步骤,没有遵循“新安装”部分,但仍然得到相同的错误

  • 这是我的
    数据库.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;出口路径到文件末尾。