Tag: heroku postgres

无法部署到Heroku,因为服务器拒绝连接

我想将我的本地Rails应用程序(完美地运行)部署到Heroku,但是收到以下错误消息: rake aborted! could not connect to server: Connection refused Is the server running on host “127.0.0.1” and accepting TCP/IP connections on port 5432? /tmp/build_21pkcz898c28o/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize’ 其次是关于postgres_adapter的很多行。 我有点失望,因为我认为Heroku覆盖了config / database.yml,所以为什么它谈论在127.0.0.1上运行服务器(我不是在寻找远程数据库)? 谢谢, 更新 如果这有帮助,运行heroku config将提供以下内容: DATABASE_URL: xxx HEROKU_POSTGRESQL_GRAY_URL: xxx (the same xxx as above)

Postgress错误捆绑安装

当我跑 $ bundle install 我在heroku上运行项目所以我不得不切换到postgress。 我出于某种原因不断收到此错误。 安装pg(0.15.1)时发生错误,Bundler无法继续。 在捆绑之前确保gem install pg -v ‘0.15.1’成功。 来源’https://rubygems.org’ ruby’2.0.0′ gem’轨道’,’4.0.1′ gem’bootstrap-sass’,’2.3.2.0′ gem’bcrypt-ruby’,’3.1.2′ gem’faker’,’1.1.2′ gem’will_paginate’,’3.0.4′ gem’bootstrap-will_paginate’,’0.0.9′ group:开发,:test do gem’sqlite3’,’1.3.8′ gem’rspec-rails’,’2.13.1′ gem’guard-rspec’,’2.5.0′ gem’spork-rails’,’4.0.0′ gem’guard-spork’,’1.5.0′ gem’childprocess’,’0.3.6′ 结束 组:测试做 gem’selenium-webdriver’,’2.35.1′ gem’capybara’,’2.1.0′ gem’factory_girl_rails’,’4.2.0′ gem’granbow-rails’,’1.3.0’,:require => false gem’database_cleaner’,github:’bmabey / database_cleaner’ gem’咆哮’,’1.0.3′ gem’sass-rails’,’4.0.1′ gem’uglifier’,’2.1.1′ gem’coffee-rails’,’4.0.1′ gem’jquery-rails’,’3.0.4′ gem’turbolinks’,’1.1.1′ gem’jbuilder’,’1.0.2′ group:doc do gem’sdd’,’0.3.20’,要求:false 结束 组:生产做 gem’pg’,’0.15.1′ gem’rails_12factor’,’0.0.2′ 结束

Heroku架构加载:数据库“postgres”用户的权限被拒绝

我正在尝试将我的Rails应用程序部署到Heroku,现在我想加载我的架构。 我收到以下错误: Running `bundle exec rake db:schema:load` attached to terminal… up, run.1533 rake aborted! PG::ConnectionBad: FATAL: permission denied for database “postgres” DETAIL: User does not have CONNECT privilege. 这很奇怪,因为postgres不是它应该连接的数据库。 通过ENV可供应用程序使用的数据库URL具有正确的值,而长期显然是随机的名称d3kwlkwlwjwljetc… 搜索此消息可以让我尝试删除或重置数据库的人,这不是我正在做的事情。 我有0行 我试过pg:reset ,甚至删除并放回数据库。 徒劳无功。 我不是在做db:drop ,只是db:schema:load 我傻眼了。 为什么我的应用无法连接? 编辑:显然,我无法schema:load ,但我可以迁移我的所有迁移。 这是为什么?

如何为heroku应用程序更改DATABASE_URL

我已准备好外部数据库,现在想要使用我的heroku应用程序使用该数据库。 但是我无法编辑配置变量。 我尝试使用GUI,其中说,无法覆盖附件值DATABASE_URL。 虽然我也尝试使用CLI。 我使用了命令:heroku config:addDATABASE_URL =“postgresql:// username:password @ IP:PORT”。 但是,这会引发错误……..不是heroku命令。

当ID存在时,获取“表的未知主键”

我一直在调试这个Rails的奇怪问题,给我“桌子的未知主键……”,即使桌子的ID在那里。 我已经将数据库从一个heroku应用程序复制到另一个,在原始数据库上没有问题,新的一个给了我一个db错误。 这是错误: ProductsController# (ActionView::Template::Error) “Unknown primary key for table collections in model Collection.” /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/reflection.rb:366:in `primary_key’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/reflection.rb:480:in `association_primary_key’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:58:in `block in add_constraints’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:39:in `each’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:39:in `each_with_index’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:39:in `add_constraints’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:31:in `scope’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association.rb:98:in `association_scope’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association.rb:87:in `scoped’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/collection_association.rb:573:in `first_or_last’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/collection_association.rb:105:in `last’ /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/collection_proxy.rb:46:in `last’ /app/app/helpers/likes_helper.rb:62:in `significant_liker’ 导致它的线: product.collections.last.try :user 和表: d8apjspa441pad=> \d collections Table “public.collections” Column | Type | […]

gem install dm-postgres-adapter build错误

我正在尝试构建dm-postgres-adapter但是得到了这个错误。 sudo gem install dm-postgres-adapter Building native extensions. This could take a while… ERROR: Error installing dm-postgres-adapter: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb checking for main() in -lpq… yes checking for libpq-fe.h… yes checking for libpq/libpq-fs.h… yes checking for postgres.h… yes checking for mb/pg_wchar.h… no *** extconf.rb failed *** Could not create […]