Heroku拒绝推送,并显示以下消息:
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Running: rake assets:precompile
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out
and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on
this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_c758e521-24e9-4477-b6d7-73
cc961fb8d2/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out
and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on
this: (called from <top (required)> at /tmp/build_c758e521-24e9-4477-b6d7-73
cc961fb8d2/Rakefile:7)
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_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `initialize'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `new'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `connect'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:324:in `initialize'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:28:in `new'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:28:in `postgresql_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:315:in `new_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:325:in `checkout_new_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:247:in `block (2 levels) in checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:242:in `loop'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:242:in `block in checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:239:in `checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:102:in `block in connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:101:in `connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:410:in `retrieve_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_specification.rb:171:in `retrieve_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_specification.rb:145:in `connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:310:in `cle
ar_cache!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/railtie.rb:103:in `block (2
levels) in <class:Railtie>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:418:in `_run
__1575907776091260551__prepare__1163126976531258673__callbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__ru
n_callback'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run
_prepare_callbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_c
allbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:74:i
n `prepare!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:48:i
n `prepare!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application/finisher.rb:47:in `block in
<module:Finisher>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_in
itializers'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializer
s'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_m
issing'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/config/environment.rb:5:in `<top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `r
equire'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `b
lock in require'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `l
oad_dependency'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `r
equire'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:103:in `require_environm
ent!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:305:in `block (2 levels)
in initialize_tasks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:93:in `block (2 level
s) in <top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:60:in `block (3 level
s) in <top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:23:in `invoke_or_rebo
ot_rake_task'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 level
s) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
我在Stackoverflow中尝试了其他解决方案但没有取得任何成功:
包括gem rails_12factor
在application.rb中添加“config.assets.initialize_on_precompile = false”行
将Sql3lite gem放入开发/测试组
我也试过自己的一些,包括:
创建一个新的堆栈雪松应用程序
添加新的SSH密钥
安装了Heroku工具带。
在制作中评论PG gem
删除Gemfile.lock
我的代码位于https://github.com/charleshsu168/sample_app1 我正在接受Michael Hartl教程。
答案 0 :(得分:0)
弃权警告:与你的问题无关,我把它们放在我的实时服务器上。
看起来Rails认为您的数据库服务器在本地可用,因此它正在尝试连接到本地主机127.0.0.1。
基于日志,看起来像数据库配置问题。你有正确配置的postgres吗? https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-ruby。
postgresql_adapter.rb:28:在`postgresql_connection'
答案 1 :(得分:0)
我通过反复试验以某种方式工作。我做的一件事就是删除了.git / config中不再存在的旧Heroku远程URL,将其替换为我创建的新Heroku应用程序名称,然后重新运行:Heroku push master 现在它有效!