我试图推动但不工作
我的Gem文件看起来像
source 'https://rubygems.org'
gem 'rails', '3.2.21'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'sqlite3'
gem 'pg'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'

在我命令之后
git push heroku master
$ git push heroku master
Counting objects: 75, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (62/62), done.
Writing objects: 100% (75/75), 27.31 KiB | 0 bytes/s, done.
Total 75 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: ###### WARNING:
remote: Removing `Gemfile.lock` because it was generated on Windows.
remote: Bundler will do a full resolve so native gems are handled properl
y.
remote: This may result in unexpected gem versions being used in your app
.
remote: In rare occasions Bundler may not be able to resolve your depende
ncies at all.
remote: https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using 1.9.7
remote: Running: bundle install --without development:test --path vendor/
bundle --binstubs vendor/bundle/bin -j4
remote: Fetching gem metadata from https://rubygems.org/............
remote: Fetching version metadata from https://rubygems.org/...
remote: Fetching dependency metadata from https://rubygems.org/..
remote: Resolving dependencies.....
remote: Rubygems 2.0.14 is not threadsafe, so your gems must be installed
one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem insta
llation.
remote: Installing rake 10.4.2
remote: Installing i18n 0.7.0
remote: Installing multi_json 1.11.2
remote: Installing activesupport 3.2.21
remote: Installing builder 3.0.4
remote: Installing activemodel 3.2.21
remote: Installing erubis 2.7.0
remote: Installing journey 1.0.4
remote: Installing rack 1.4.7
remote: Installing rack-cache 1.2
remote: Installing rack-test 0.6.3
remote: Installing hike 1.2.3
remote: Installing tilt 1.4.1
remote: Installing sprockets 2.2.3
remote: Installing actionpack 3.2.21
remote: Installing mime-types 1.25.1
remote: Installing polyglot 0.3.5
remote: Installing treetop 1.4.15
remote: Installing mail 2.5.4
remote: Installing actionmailer 3.2.21
remote: Installing arel 3.0.3
remote: Installing tzinfo 0.3.44
remote: Installing activerecord 3.2.21
remote: Installing activeresource 3.2.21
remote: Using bundler 1.9.7
remote: Installing coffee-script-source 1.9.1.1
remote: Installing execjs 2.5.2
remote: Installing coffee-script 2.4.1
remote: Installing rack-ssl 1.3.4
remote: Installing json 1.8.3
remote: Installing rdoc 3.12.2
remote: Installing thor 0.19.1
remote: Installing railties 3.2.21
remote: Installing coffee-rails 3.2.2
remote: Installing jquery-rails 3.1.3
remote: Installing pg 0.18.2
remote: Installing rails 3.2.21
remote: Installing sass 3.4.16
remote: Installing sass-rails 3.2.6
remote: Installing uglifier 2.7.1
remote: Bundle complete! 6 Gemfile dependencies, 40 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Post-install message from rdoc:
remote: Depending on your version of ruby, you may need to install ruby r
doc/ri data:
remote: <= 1.8.6 : unsupported
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Bundle completed (80.47s)
remote: Cleaning up the bundler cache.
remote: -----> Writing config/database.yml to read from DATABASE_URL
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/p
lugins! Support for these plugins will be removed in Rails 4.0. Move them out an
d 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_b38abca32e7ecaaf883fae6625ceb01f/Rakefile:7)
remote: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/p
lugins! Support for these plugins will be removed in Rails 4.0. Move them out an
d 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_b38abca32e7ecaaf883fae6625ceb01f/Rakefile:7)
remote: rake aborted!
remote: PG::ConnectionBad: could not connect to server: Connection refuse
d
remote: Is the server running on host "127.0.0.1" and accepting
remote: TCP/IP connections on port 5432?
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/postgresql_ad
apter.rb:1222:in `initialize'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/postgresql_ad
apter.rb:1222:in `new'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/postgresql_ad
apter.rb:1222:in `connect'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/postgresql_ad
apter.rb:324:in `initialize'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/postgresql_ad
apter.rb:28:in `new'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/postgresql_ad
apter.rb:28:in `postgresql_connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:315:in `new_connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:325:in `checkout_new_connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:247:in `block (2 levels) in checkout'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:242:in `loop'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:242:in `block in checkout'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:239:in `checkout'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:102:in `block in connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:101:in `connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_pool.rb:410:in `retrieve_connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_specification.rb:171:in `retrieve_connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/conn
ection_specification.rb:145:in `connection'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/model_schema.rb:310:in `clear_cac
he!'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activerecord-3.2.21/lib/active_record/railtie.rb:103:in `block (2 level
s) in <class:Railtie>'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:418:in `_run__3484
198801275101306__prepare__2196888947682683501__callbacks'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_call
back'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_prepa
re_callbacks'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbac
ks'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/reloader.rb:74:in `pre
pare!'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/reloader.rb:48:in `pre
pare!'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/application/finisher.rb:47:in `block in <modu
le:Finisher>'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `instance_exec'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `run'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/initializable.rb:55:in `block in run_initiali
zers'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `each'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `run_initializers'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/application.rb:136:in `initialize!'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in `method_missing
'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/config/environment.rb
:5:in `<top (required)>'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require
'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `block i
n require'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_de
pendency'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require
'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/application.rb:103:in `require_environment!'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/railties-3.2.21/lib/rails/application.rb:305:in `block (2 levels) in in
itialize_tasks'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:93:in `block (2 levels) in
<top (required)>'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:60:in `block (3 levels) in
<top (required)>'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rak
e_task'
remote: /tmp/build_b38abca32e7ecaaf883fae6625ceb01f/vendor/bundle/ruby/2.
0.0/gems/actionpack-3.2.21/lib/sprockets/assets.rake:29:in `block (2 levels) in
<top (required)>'
remote: Tasks: TOP => environment
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: ! Attempted to access a nonexistent database:
remote: ! https://devcenter.heroku.com/articles/pre-provision-database
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to mysterious-headland-8039.
remote:
To https://git.heroku.com/mysterious-headland-8039.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/mysterious-headland-8
039.git'
&#13;
请帮助我任何人如何摆脱这一点。
未能推出一些参考资料......我搜索了很多并进行了更多调查但我没有找到任何解决方案。
请帮我摆脱这个。
由于
答案 0 :(得分:0)
看起来问题出在你正在使用的Heroku Postgres数据库上。
remote: rake aborted! remote: PG::ConnectionBad: could not connect to server: Connection refuse d remote: Is the server running on host "127.0.0.1" and accepting remote: TCP/IP connections on port 5432?
如果您有敏感数据,请不要执行此操作 - 在Heroku上的应用程序resources page
中,您可以尝试删除Heroku Postgres
插件,然后将其添加回来。
如果在生产中发生这种情况,您可以写信给heroku支持。如果您可以捕获数据库快照并在应用程序运行时将其存储回来,则可以尝试上述操作。