首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Heroku无效的DATABASE_URL当推送- Heroku错误,现在修复

Heroku无效的DATABASE_URL当推送- Heroku错误,现在修复
EN

Stack Overflow用户
提问于 2013-07-23 23:41:39
回答 1查看 708关注 0票数 0

编辑:

这是他们修复的Heroku的临时错误。

我对heroku的推动/部署在上周起作用时失败了。这是一个在雪松堆上使用activerecord的sinatra应用程序。

我能够在Heroku上部署和运行几次我的应用程序。我在用postgres和雪松堆。

我做了一个空格更改为app.rb和推送,推送没有被接受。

该应用程序目前正在服务器上使用上周的代码。它正在使用数据库,所以它可以看到它。

Heroku和heroku配置正确地列出了DATABASE_URL。

我已经创建了一个新的数据库,并提升了它,但是它没有帮助(运行的实例使用了新的数据库okay)。

我在雪松堆栈上创建了一个新的dyno,建立了一个新的db并提供了它,但是也无法用相同的错误将代码推送给它。

下面是错误消息:在本例中,我试图使用sinatra activerecord的最新版本来查看是否存在bug (这没有帮助)

代码语言:javascript
复制
git push heroku heroku_bug_before:master
Counting objects: 20, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.60 KiB, done.
Total 14 (delta 9), reused 0 (delta 0)

-----> Ruby/Rack app detected
-----> Using Ruby version: ruby-1.9.2
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Fetching gem metadata from https://rubygems.org/.........
       Fetching gem metadata from https://rubygems.org/..
       Using i18n (0.6.1)
       Using multi_json (1.7.7)
       Using activesupport (3.2.13)
       Using builder (3.0.4)
       Using activemodel (3.2.13)
       Using arel (3.0.2)
       Using tzinfo (0.3.37)
       Using activerecord (3.2.13)
       Using backports (3.3.3)
       Using bond (0.4.3)
       Using eventmachine (1.0.3)
       Using kgio (2.8.0)
       Using libxml-ruby (2.6.0)
       Using mime-types (1.23)
       Using oj (2.1.4)
       Using pg (0.15.1)
       Using r18n-core (1.1.5)
       Using rack (1.5.2)
       Using rack-protection (1.5.0)
       Using rack-test (0.6.2)
       Using raindrops (0.11.0)
       Using rest-client (1.6.7)
       Using ripl (0.7.0)
       Using ripl-multi_line (0.3.1)
       Using ripl-rack (0.2.0)
       Using tilt (1.4.1)
       Using sinatra (1.3.2)
       Installing sinatra-activerecord (1.2.3)
       Using sinatra-contrib (1.3.2)
       Using sinatra-flash (0.3.0)
       Using sinatra-r18n (1.1.5)
       Using tux (0.3.0)
       Using unicorn (4.6.3)
       Using bundler (1.3.2)
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
       Removing sinatra-activerecord (1.2.2)
-----> Writing config/database.yml to read from DATABASE_URL
 !
 !     rake aborted!
 !     Invalid DATABASE_URL
 !     (erb):9:in `rescue in <main>'
 !     (erb):6:in `<main>'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/erb.rb:753:in `eval'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/erb.rb:753:in `result'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-activerecord-1.2.3/lib/sinatra/activerecord.rb:39:in `database_file='
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:983:in `set'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-activerecord-1.2.3/lib/sinatra/activerecord.rb:50:in `registered'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1262:in `block in register'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1260:in `each'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1260:in `register'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1590:in `register'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1630:in `register'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-activerecord-1.2.3/lib/sinatra/activerecord.rb:76:in `<module:Sinatra>'
 !     /tmp/build_2b0q7ep6511dz/vendor/bundle/ruby/1.9.1/gems/sinatra-activerecord-1.2.3/lib/sinatra/activerecord.rb:6:in `<top (required)>'
 !     /tmp/build_2b0q7ep6511dz/app.rb:2:in `require'
 !     /tmp/build_2b0q7ep6511dz/app.rb:2:in `<top (required)>'
 !     /tmp/build_2b0q7ep6511dz/Rakefile:1:in `require'
 !     /tmp/build_2b0q7ep6511dz/Rakefile:1:in `<top (required)>'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
 !     (eval):1:in `block in standard_rake_options'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2213:in `eval'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2213:in `block in standard_rake_options'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/optparse.rb:1308:in `call'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/optparse.rb:1308:in `block in parse_in_order'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/optparse.rb:1264:in `catch'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/optparse.rb:1264:in `parse_in_order'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/optparse.rb:1258:in `order!'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/optparse.rb:1349:in `permute!'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/optparse.rb:1370:in `parse!'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2303:in `handle_options'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:1999:in `block in init'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:1997:in `init'
 !     /tmp/ruby-1.9.2/lib/ruby/1.9.1/rake.rb:1990:in `run'
 !     /tmp/ruby-1.9.2/bin/rake:31:in `<main>'
 !     (in /tmp/build_2b0q7ep6511dz)
 !
sh: Syntax error: Unterminated quoted string

 !     Push rejected, failed to compile Ruby/Rack app

heroku配置(您可以看到我添加和提升的额外db )

代码语言:javascript
复制
=== visualtags Config Vars
DATABASE_URL:                 postgres://changed1:changed@ec2-54-217-215-81.eu-west-1.compute.amazonaws.com:5432/changed1
HEROKU_POSTGRESQL_COBALT_URL: postgres://changed2:changed@ec2-54-217-215-81.eu-west-1.compute.amazonaws.com:5432/changed2
HEROKU_POSTGRESQL_CYAN_URL:   postgres://changed3:changed@ec2-54-217-215-96.eu-west-1.compute.amazonaws.com:5432/changed3

heroku pg:info

代码语言:javascript
复制
=== HEROKU_POSTGRESQL_COBALT_URL (DATABASE_URL)
Plan:        Dev
Status:      available
Connections: 4
PG Version:  9.2.4
Created:     2013-07-23 17:49 UTC
Data Size:   6.4 MB
Tables:      2
Rows:        4/10000 (In compliance) - refreshing
Fork/Follow: Unsupported
Region:      Europe

heroku信息

代码语言:javascript
复制
=== herokuapp
Addons:        heroku-postgresql:dev
               heroku-postgresql:dev

Git URL:       xxx
Owner Email:   mine@example.com
Region:        eu
Repo Size:     8M
Slug Size:     17M
Stack:         cedar
Tier:          Legacy
Web URL:       http://xxx.herokuapp.com/

我花了好几个小时在这上面--它上周起作用了,但现在它不再起作用了。我正在使用Unicorn和ActiveRecord,并遵循文档中的建议.

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2013-07-24 00:25:35

与Padrino/Datamapper和Heroku Postgre基本计划相同的问题是,从今天早上起我就再也无法部署了。

当我运行'heroku‘时,DATABASE_URL配置变量似乎被正确设置,并且我可以使用ENV’‘DATABASE_URL从Padrino控制台访问它,所以不确定是什么导致了问题。

这个家伙的URL fails已经能够直接使用HEROKU_POSTGRESQL_color_URL,它修复了它,但不是为我的应用程序。

看起来像Heroku部署脚本中的一个问题,最好的方法就是用它们( https://help.heroku.com/tickets/new?query=postgre )引发一张票。

(对不起,这与其说是一个真实的回答,不如说是一个评论,显然我没有足够的代表发表评论)

编辑: Heroku回答说,问题已经解决了,我可以再次成功地部署我的应用程序。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17822832

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档