Solucionado (ver solução)
Solucionado
(ver solução)
26
respostas

Heroku

Não condigo fazer o deplou de maneira alguma,

sempre da:

push rejected, failed to compile ruby app

26 respostas

Oi Ernaldo,

Se você tenta rodar tudo local funciona? Aparece alguma outra coisa no log do push?

Ele inicia o deploy, aparentemente tudo ok, e bem no final, sempre da: push rejected, failed to compile ruby app

Cola aqui o seu log pra ficar melhor de ver, às vezes ele mostra alguma informação relevante lá no meio.

ernaldo@ernaldo-VirtualBox:~/job_board$ git push heroku master
Counting objects: 119, done.
Compressing objects: 100% (109/109), done.
Writing objects: 100% (119/119), 35.79 KiB | 47.00 KiB/s, done.
Total 119 (delta 7), 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: -----> Installing dependencies using 1.9.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
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:        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 installation.
remote:        Installing rake 10.4.2
remote:        Installing i18n 0.7.0
remote:        Installing multi_json 1.11.1
remote:        Installing activesupport 3.2.17
remote:        Installing builder 3.0.4
remote:        Installing activemodel 3.2.17
remote:        Installing erubis 2.7.0
remote:        Installing journey 1.0.4
remote:        Installing rack 1.4.5
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.17
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.17
remote:        Installing arel 3.0.3
remote:        Installing tzinfo 0.3.44
remote:        Installing activerecord 3.2.17
remote:        Installing activeresource 3.2.17
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.17
remote:        Installing coffee-rails 3.2.2
remote:        Installing jquery-rails 3.1.2
remote:        Installing pg 0.18.2
remote:        Using bundler 1.9.7
remote:        Installing rails 3.2.17
remote:        Installing sass 3.4.14
remote:        Installing sass-rails 3.2.6
remote:        Installing uglifier 2.7.1
remote:        Installing will_paginate 3.0.7
remote:        Bundle complete! 8 Gemfile dependencies, 41 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 rdoc/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 (53.48s)
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/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_e4e783331368a024933510ef1f3ecedb/Rakefile:7)
remote:        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_e4e783331368a024933510ef1f3ecedb/Rakefile:7)
remote:        rake aborted!
remote:        PG::ConnectionBad: could not connect to server: Connection refused
remote:        Is the server running on host "127.0.0.1" and accepting
remote:        TCP/IP connections on port 5432?
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/model_schema.rb:310:in `clear_cache!'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/railtie.rb:103:in `block (2 levels) in <class:Railtie>'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:418:in `_run__2182530327929380068__prepare__1114556435851483491__callbacks'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:405:in `__run_callback'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:81:in `run_callbacks'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `instance_exec'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `run'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:55:in `block in run_initializers'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `each'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `run_initializers'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application.rb:136:in `initialize!'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/config/environment.rb:5:in `<top (required)>'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application.rb:103:in `require_environment!'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
remote:        /tmp/build_e4e783331368a024933510ef1f3ecedb/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/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 sleepy-headland-5686.
remote: 
To https://git.heroku.com/sleepy-headland-5686.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sleepy-headland-5686.git'
ernaldo@ernaldo-VirtualBox:~/job_board$ push^C
ernaldo@ernaldo-VirtualBox:~/job_board$ ^C
ernaldo@ernaldo-VirtualBox:~/job_board$

local esta tudo funcionando.

Ernaldo,

Ele tá dando pau pra conectar no PostgreSQL, veja se vc configurou no Heroku o banco certinho.

remote:        PG::ConnectionBad: could not connect to server: Connection refused
remote:        Is the server running on host "127.0.0.1" and accepting
remote:        TCP/IP connections on port 5432?

Abraço!

fiz tudo como indicava os exercicio e assim esta configurado:

gem 'sqlite3', group: [:development, :test] gem 'pg', group: :production

Nao há um instrutor aqui?

Cade o instrutor deste video, o cara é pessimo. Eu pago esta merda pra q mesmo? pra assistir video, tem uma infinidade de graça por ai.

Oi Ernaldo,

O que mudou foi a configuração do Heroku, estou testando aqui o passo-a-passo e já te aviso.

Abraço

Obrigado Joviane.

vc faz parte do corpo de instrutores?

Oi Ernaldo, sou sim.

O seu problema é que agora o Heroku tenta conectar no banco de dados antes de compilar os assets. Pra evitar que isto aconteça, é só colocar dentro do arquivo config/application.rb a seguinte linha:

config.assets.initialize_on_precompile = false

Depois que você colocar esta linha, é só commitar o código e tentar efetuar o push novamente. Para o Rails 4 não é necessário efetuar esta configuração.

Me avise depois de testar,

Abraço!

MESMA COISA

remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        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_cd5e9a3470dab46438ba25f3eb055b4f/Rakefile:7)
remote:        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_cd5e9a3470dab46438ba25f3eb055b4f/Rakefile:7)
remote:        rake aborted!
remote:        PG::ConnectionBad: could not connect to server: Connection refused
remote:        Is the server running on host "127.0.0.1" and accepting
remote:        TCP/IP connections on port 5432?
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/model_schema.rb:310:in `clear_cache!'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.17/lib/active_record/railtie.rb:103:in `block (2 levels) in <class:Railtie>'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:418:in `_run__3737673046932665098__prepare__3959656003987421531__callbacks'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:405:in `__run_callback'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/callbacks.rb:81:in `run_callbacks'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `instance_exec'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `run'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:55:in `block in run_initializers'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `each'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `run_initializers'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application.rb:136:in `initialize!'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/config/environment.rb:5:in `<top (required)>'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application.rb:103:in `require_environment!'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/railties-3.2.17/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
remote:        /tmp/build_cd5e9a3470dab46438ba25f3eb055b4f/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.17/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 sleepy-headland-5686.
remote: 
To https://git.heroku.com/sleepy-headland-5686.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sleepy-headland-5686.git'

Ernaldo,

Faz o seguinte então, vamos configurar a database no Heroku.

1) No Terminal, digite o comando abaixo:

heroku addons:create heroku-postgresql

2) Assim que você rodar, deve aparecer algo do tipo:

Adding heroku-postgresql on blooming-refuge-2596.. done, v4 (free)
Attached as HEROKU_POSTGRESQL_CRIMSON_URL.
Database has been created and is available
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pgbackups:restore.
Use `heroku addons:docs heroku-postgresql` to view documentation.

3) Onde aparece blooming-refuge-2596 e HEROKU_POSTGRESQL_CRIMSON_URL pode estar diferente, não tem problema

4) Tente dar o push novamente:

git push heroku master

Com este passo a passo, estamos configurando a database do PostgreSQL no Heroku, já que agora ele fica tentando se conectar para compilar os assets.

Se tudo isso não funcionar, aí você terá que compilar os assets pra produção localmente e commitá-los. Você pode fazer isso digitando no terminal:

RAILS_ENV=production bundle exec rake assets:precompile

Isto compilará os assets e aí é só commitar e pushar novamente.

Só faça essa última compilação se os passos anteriores não funcionarem.

Me avisa, se der certo.

Abraço!

Logo depois do primeiro comando:

Missing request service or plan

Você tentou a última opção?

RAILS_ENV=production bundle exec rake assets:precompile

INFELIzmente tudo continua exatamente igual.

Oi Ernaldo,

me manda um e-mail (joviane.jardim@caelum.com.br) com suas informações (github e url do Heroku), isso é um problema do Heroku, vamos tentar solucionar juntos.

Abraço,

Joviane

De verdade, tenta fazer um tutorial novo de deploy no heroku, eu uso ubuntu e to penando pra conseguir, cada hora é 1 problema

Eu comecei no windows e mal consegui instalar o ruby. Agora uso o Ubuntu. Ja estou pensando em tentar novamente pelo windows. O que vc acha Joviane?

Eu não sabia nada de Ruby, nem de programação, e muito menos de Linux.

Conversei com um amigo que trabalha na área, e ele me falou o seguinte:

"como vc não tem Mac, usa o Ubuntu, vc vai penar, vai ser mais difícil no começo, mas vc vai me agradecer depois"

Dito e feito, tive muitos problemas de instalação e configuração, mas nada que uma pesquisa no Google não tenha resolvido. Depois viera problemas de compatibilidade dos códigos, pois o curso é feito para rails 3 e eu utilizei o 4, mas pesquisei e resolvi (inclusive aprendendo mais durante o processo). Quando fiz o deploy, pelo Ubuntu, foi super fácil, simplesmente pq estava utilizando as versões atualizadas de Ruby e Rails. Inclusive para instalar o toolbelt do Heroku com o Ubuntu foi ridiculamente simples,

no terminal:

sudo wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh

depois é só seguir os comandos do vídeo.

Obs. Durante o comando

git commit -m 'Initial commit'

o terminal apresentará a mensagem

* Please tell me who you are.

Run

git config --global user.email "you@example.com" git config --global user.name "Your Name"

to set your account's default identity. Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'iujisato@Ubuntu14.(none)')

como o próprio terminal diz, basta rodar o comando

git config --global user.email "seu email" git config --global user.name "seu nome de usuario"

e rodar novamente git commit -m 'Initial commit'

fora isso aqui foi tudo 100% e sem problemas

Amigo, eu não tive esse problema, mas tente usar esse guia

http://stackoverflow.com/questions/15737296/heroku-push-rejected-failed-to-compile-ruby-rails-app

solução!

Esse problema é bem comum pois ele fica tentando conectar na database antes de compilar os assets.

Acho que com o Windows você vai ter bem mais problema de compatibilidade do que com o Linux viu...

Dá uma olhada nesse link do Heroku: https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting

Ernaldo, você conseguiu fazer o deploy?

Caso não, eu dei uma olhada em seu log e pensei o seguinte:

Sua aplicação usa Postgresql? por padrão, o rails inicia as apps com Sqlite3 e o Heroku, por padrão, utiliza postgres.

No seu log há essa parte:

remote:        PG::ConnectionBad: could not connect to server: Connection refused
remote:        Is the server running on host "127.0.0.1" and accepting
remote:        TCP/IP connections on port 5432?

O heroku não está conseguindo acessar seu banco de dados Postgres. Se você usa Sqlite, faz sentido que ele não consiga. Resumindo: é possível que sua app esteja usando sqlite e o heroku está configurado para usar postgres.

eu sugiro que use postgres. Todavia, trocar o bd on the fly pode se tornar meio complexo. Se a app for pequena, você pode refazê-la, mas inicie a app assim:

rails new myapp --database=postgresql

ps.: lembre-se de ter o postgres instalado na sua máquina e um user com o nome do seu usuario para facilitar a vida em ambiente dev local :)

Isso faz sentido pra você?

Joviane, eu também estou com problema no momento do deploy, porém o erro que dá comigo é um pouco diferente.

emote: 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: -----> Installing dependencies using 1.9.7 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Your Gemfile lists the gem sqlite3 (>= 0) more than once. remote: You should probably keep only one of them. remote: While it's not a problem now, it could cause errors if you change the version of just one of them later. 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: 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 installation. remote: Installing rake 10.4.2 remote: Installing i18n 0.7.0 remote: Installing multi_json 1.11.2 remote: Installing activesupport 3.2.17 remote: Installing builder 3.0.4 remote: Installing activemodel 3.2.17 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.17 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.17 remote: Installing arel 3.0.3 remote: Installing tzinfo 0.3.44 remote: Installing activerecord 3.2.17 remote: Installing activeresource 3.2.17 remote: Installing coffee-script-source 1.9.1.1 remote: Installing execjs 2.6.0 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.17 remote: Installing coffee-rails 3.2.2 remote: Installing jquery-rails 3.1.3 remote: Installing pg 0.17.1 remote: Using bundler 1.9.7 remote: Installing rails 3.2.17 remote: Installing sass 3.4.16 remote: Installing sass-rails 3.2.6 remote: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. remote: /tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/ruby-2.0.0/bin/ruby extconf.rb remote: checking for sqlite3.h... no remote: sqlite3.h is missing. Try 'port install sqlite3 +universal', remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' remote: and check your shared library search path (the remote: location where your sqlite3 shared library is located). remote: extconf.rb failed remote: Could not create Makefile due to some reason, probably lack of necessary remote: libraries and/or headers. Check the mkmf.log file for more details. You may remote: need configuration options. remote: Provided configuration options: remote: --with-opt-dir remote: --without-opt-dir remote: --with-opt-include remote: --without-opt-include=${opt-dir}/include remote: --with-opt-lib remote: --without-opt-lib=${opt-dir}/lib remote: --with-make-prog remote: --without-make-prog remote: --srcdir=. remote: --curdir remote: --ruby=/tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/ruby-2.0.0/bin/ruby remote: --with-sqlite3-dir remote: --without-sqlite3-dir remote: --with-sqlite3-include remote: --without-sqlite3-include=${sqlite3-dir}/include remote: --with-sqlite3-lib remote: --without-sqlite3-lib=${sqlite3-dir}/ remote: Gem files will remain installed in /tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection. remote: Results logged to /tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out remote: An error occurred while installing sqlite3 (1.3.10), and Bundler cannot remote: continue. remote: Make sure that gem install sqlite3 -v '1.3.10' succeeds before bundling. remote: Bundler Output: Your Gemfile lists the gem sqlite3 (>= 0) more than once. remote: You should probably keep only one of them. remote: While it's not a problem now, it could cause errors if you change the version of just one of them later. 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: 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 installation. remote: Installing rake 10.4.2 remote: Installing i18n 0.7.0 remote: Installing multi_json 1.11.2 remote: Installing activesupport 3.2.17 remote: Installing builder 3.0.4 remote: Installing activemodel 3.2.17 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.17 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.17 remote: Installing arel 3.0.3 remote: Installing tzinfo 0.3.44 remote: Installing activerecord 3.2.17 remote: Installing activeresource 3.2.17 remote: Installing coffee-script-source 1.9.1.1 remote: Installing execjs 2.6.0 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.17 remote: Installing coffee-rails 3.2.2 remote: Installing jquery-rails 3.1.3 remote: Installing pg 0.17.1 remote: Using bundler 1.9.7 remote: Installing rails 3.2.17 remote: Installing sass 3.4.16 remote: Installing sass-rails 3.2.6 remote:remote: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. remote:remote: /tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/ruby-2.0.0/bin/ruby extconf.rb remote: checking for sqlite3.h... no remote: sqlite3.h is missing. Try 'port install sqlite3 +universal', remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' remote: and check your shared library search path (the remote: location where your sqlite3 shared library is located). remote: extconf.rb failed remote: Could not create Makefile due to some reason, probably lack of necessary remote: libraries and/or headers. Check the mkmf.log file for more details. You may remote: need configuration options. remote:remote: Provided configuration options: remote: --with-opt-dir remote: --without-opt-dir remote: --with-opt-include remote: --without-opt-include=${opt-dir}/include remote: --with-opt-lib remote: --without-opt-lib=${opt-dir}/lib remote: --with-make-prog remote: --without-make-prog remote: --srcdir=. remote: --curdir remote: --ruby=/tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/ruby-2.0.0/bin/ruby remote: --with-sqlite3-dir remote: --without-sqlite3-dir remote: --with-sqlite3-include remote: --without-sqlite3-include=${sqlite3-dir}/include remote: --with-sqlite3-lib remote: --without-sqlite3-lib=${sqlite3-dir}/ remote:remote:remote: Gem files will remain installed in /tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection. remote: Results logged to /tmp/build_8d106ce30c2be2ce51c81077680b82bd/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out remote: An error occurred while installing sqlite3 (1.3.10), and Bundler cannot remote: continue. remote: Make sure that gem install sqlite3 -v '1.3.10' succeeds before bundling. remote: ! remote: ! Failed to install gems via Bundler. remote: !remote: ! Detected sqlite3 gem which is not supported on Heroku. remote: ! https://devcenter.heroku.com/articles/sqlite3 remote: ! remote: remote: ! Push rejected, failed to compile Ruby app remote: remote: Verifying deploy.... remote: remote: ! Push rejected to evening-river-2256. remote: To https://git.heroku.com/evening-river-2256.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/evening-river-2256.git

o que pode ser?

provavelmente o erro está por aqui!

Detected sqlite3 gem which is not supported on Heroku

no tópico mesmo tem algumas informações sobre o problema do heroku com banco da dados, tente procurar em cima disso