2

我最近将现有的 rails 3.2.3 应用程序迁移到 rails 4.0.0.rc2。我已经进行了所有必要的更改,并且能够使其在本地正常工作。但是当我将它推送到heroku - “git push heroku master”时,它说未能推送一些参考。以下是堆栈跟踪 -

-----> 编写 config/database.yml 以从 DATABASE_URL 读取 -----> 为 Rails 资产管道准备应用程序正在运行:rake assets:precompile rake aborted!无法连接到服务器:连接被拒绝 服务器是否在主机“127.0.0.1”上运行并接受端口 5432 上的 TCP/IP 连接?/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in initialize' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/postgresql_adapter.rb:825:innew' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby /2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in connect' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/postgresql_adapter.rb:542:ininitialize' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0 .0.rc2/lib/active_record/connection_adapters/postgresql_adapter.rb:41:innew' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/postgresql_adapter.rb:41:inpostgresql_connection' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in new_connection' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:incheckout_new_connection'/tmp/build_uqaojzpp3n68/vendor /bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in acquire_connection' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:inblock in checkout' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0 .0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in checkout' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:inblock in connection' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord -4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:inconnection' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in检索连接'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_handling.rb:79:in retrieve_connection' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/connection_handling.rb:53:inconnection'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby /2.0.0/gems/activerecord-4.0.0.rc2/lib/active_record/model_schema.rb:203:in table_exists?' /tmp/build_uqaojzpp3n68/lib/custom_active_record/domain_constants_pool.rb:13:inevaluate_constants' /tmp/build_uqaojzpp3n68/app/models/user_type.rb:4:in <class:UserType>' /tmp/build_uqaojzpp3n68/app/models/user_type.rb:1:in' /tmp/build_uqaojzpp3n68/ vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in require' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:inblock in require' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/ gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:213:inload_dependency' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in要求'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/ active_support/dependencies.rb:329:在require_or_load' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:462:inload_missing_constant' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:183:in const_missing' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:494:inload_missing_constant' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby /2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:183:in const_missing' /tmp/build_uqaojzpp3n68/app/models/user.rb:13:in' /tmp/build_uqaojzpp3n68/app/models/user.rb:1:in<top (required)>' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in要求' /tmp/build_uqaojzpp3n68/ vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in block in require' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:213:inload_dependency' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/ activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in require' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:329:inrequire_or_load' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/依赖项.rb:462:在load_missing_constant' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:183:inconst_missing' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/inflector/methods.rb:226:in const_get' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/inflector/methods.rb:226:inblock in constantize' /tmp/build_uqaojzpp3n68/vendor /bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/inflector/methods.rb:224:in injection each' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/inflector/methods.rb:224:in' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems /activesupport-4.0.0.rc2/lib/active_support/inflector/methods.rb:224:in constantize' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:534:inget' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib /active_support/dependencies.rb:565:in constantize' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise.rb:274:inget' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise/mapping.rb:77:into' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise/mapping.rb:72:in模块'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise/mapping.rb:89:in routes' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise/mapping.rb:156:indefault_used_route'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby /2.0.0/gems/devise-3.0.0.rc/lib/devise/mapping.rb:66:in initialize' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise.rb:308:innew' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0 .rc/lib/devise.rb:308:in add_mapping' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise/rails/routes.rb:208:inblock in devise_for' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise/rails/routes.rb :207:in each' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/devise-3.0.0.rc/lib/devise/rails/routes.rb:207:indevise_for' /tmp/build_uqaojzpp3n68/config/routes.rb:55:in block in <top (required)>' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.rc2/lib/action_dispatch/routing/route_set.rb:316:ininstance_exec' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.rc2/lib/action_dispatch /routing/route_set.rb:316:in eval_block' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0.rc2/lib/action_dispatch/routing/route_set.rb:294:indraw' /tmp/build_uqaojzpp3n68/config/routes.rb:1:in<top (required)>' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:222:in加载'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:222:in block in load' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:213:inload_dependency'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby /2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:222:in load' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application/routes_reloader.rb:40:inblock in load_paths' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0 .0.rc2/lib/rails/application/routes_reloader.rb:40:in each' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application/routes_reloader.rb:40:inload_paths' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application /routes_reloader.rb:16:in reload!' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application/routes_reloader.rb:26:inblock in updater' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/file_update_checker.rb:75:incall' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/file_update_checker.rb:75:in执行'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application/routes_reloader.rb:27:in updater' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application/routes_reloader.rb:6:inexecute_if_updated'/tmp/build_uqaojzpp3n68/vendor/bundle /ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application/finisher.rb:69:in block in <module:Finisher>' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/initializable.rb:30:ininstance_exec' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties -4.0.0.rc2/lib/rails/initializable.rb:30:in run' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/initializable.rb:55:inblock in run_initializers' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails /initializable.rb:54:inrun_initializers' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application.rb:215:in初始化!/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/railtie/configurable.rb:30:inmethod_missing' /tmp/build_uqaojzpp3n68/config/environment.rb:5:in' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in require' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:inblock in require' /tmp/build_uqaojzpp3n68/vendor/bundle/ ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:213:inload_dependency' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in要求'/tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0。 0.rc2/lib/rails/application.rb:189:in require_environment!' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/application.rb:249:inblock in run_tasks_blocks' /tmp/build_uqaojzpp3n68/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/ task.rb:54:in `block (2 levels) in define' 任务:TOP => 环境(通过使用--trace 运行任务查看完整跟踪)!!预编译资产失败。!

!推送被拒绝,无法编译 Ruby/Rails 应用程序

我也在本地使用 postgres,它工作正常。这个应用程序以前部署在 heroku 上。我在 Gemfile 中添加了 ruby​​ 2.0.0,日志表明他们正在使用 ruby​​ 2.0.0。我不确定如何调试它。将 heroku 上的现有应用程序迁移到 4.0.0 是否需要任何其他更改。任何帮助,将不胜感激。提前致谢。

4

1 回答 1

1

Your problem is during slug compilation the environment variables are not available to your app. Try installing the user-env-compile labs feature.

于 2013-06-21T07:49:34.147 回答