Despliegue de la aplicación en Heroku: 'NameError: Uninitialized constant Devise'

Quiero implementar mi aplicación Rails en Heroku. Por supuesto, tengo algunas gems adicionales incluidas como 'idear' o 'rails_admin'. He seguido estrictamente el tutorial de Rails Girls ( http://guides.railsgirls.com/heroku/ ). Me he enfrentado a un problema realmente molesto al ejecutar git push heroku master .

 Counting objects: 220, done. Delta compression using up to 4 threads. Compressing objects: 100% (198/198), done. Writing objects: 100% (220/220), 94.69 KiB | 0 bytes/s, done. Total 220 (delta 21), 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.7.12 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: Installing i18n 0.7.0 remote: Installing rake 10.4.2 remote: Installing minitest 5.5.1 remote: Installing thread_safe 0.3.4 remote: Installing builder 3.2.2 remote: Installing erubis 2.7.0 remote: Installing mini_portile 0.6.2 remote: Installing mime-types 2.4.3 remote: Installing rack 1.6.0 remote: Installing arel 6.0.0 remote: Installing coffee-script-source 1.8.0 remote: Installing execjs 2.2.2 remote: Installing thor 0.19.1 remote: Installing hike 1.2.3 remote: Installing multi_json 1.10.1 remote: Using bundler 1.7.12 remote: Installing tilt 1.4.1 remote: Installing rails_serve_static_assets 0.0.4 remote: Installing rails_stdout_logging 0.0.3 remote: Installing sass 3.4.10 remote: Installing tzinfo 1.2.2 remote: Installing json 1.8.2 remote: Installing mail 2.6.3 remote: Installing rack-test 0.6.3 remote: Installing coffee-script 2.3.0 remote: Installing sprockets 2.12.3 remote: Installing rails_12factor 0.0.3 remote: Installing activesupport 4.2.0.rc3 remote: Installing rdoc 4.2.0 remote: Installing uglifier 2.7.0 remote: Installing rails-deprecated_sanitizer 1.0.3 remote: Installing globalid 0.3.0 remote: Installing activemodel 4.2.0.rc3 remote: Installing jbuilder 2.2.6 remote: Installing sdoc 0.4.1 remote: Installing activejob 4.2.0.rc3 remote: Installing activerecord 4.2.0.rc3 remote: Installing nokogiri 1.6.6.2 remote: Installing pg 0.18.1 remote: Installing loofah 2.0.1 remote: Installing rails-dom-testing 1.0.5 remote: Installing rails-html-sanitizer 1.0.1 remote: Installing actionview 4.2.0.rc3 remote: Installing actionpack 4.2.0.rc3 remote: Installing actionmailer 4.2.0.rc3 remote: Installing sprockets-rails 2.2.4 remote: Installing railties 4.2.0.rc3 remote: Installing coffee-rails 4.1.0 remote: Installing jquery-rails 4.0.1 remote: Installing rails 4.2.0.rc3 remote: Installing sass-rails 5.0.1 remote: Installing turbolinks 2.5.3 remote: Your bundle is complete! remote: Gems in the groups development and test were not installed. remote: It was 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 (35.01s) remote: Cleaning up the bundler cache. remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: rake aborted! remote: NameError: uninitialized constant Devise remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/config/initializers/devise.rb:3:in '<top (requinetworking)>' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:652:in 'block in load_config_initializer' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0.rc3/lib/active_support/notifications.rb:166:in 'instrument' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:651:in 'load_config_initializer' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:616:in 'block (2 levels) in <class:Engine>' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:615:in 'each' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/engine.rb:615:in 'block in <class:Engine>' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:30:in 'instance_exec' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:30:in 'run' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:55:in 'block in run_initializers' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:44:in 'each' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:44:in 'tsort_each_child' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/initializable.rb:54:in 'run_initializers' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:352:in 'initialize!' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/config/environment.rb:5:in '<top (requinetworking)>' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:328:in 'require' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:328:in 'require_environment!' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0.rc3/lib/rails/application.rb:443:in 'block in run_tasks_blocks' remote: /tmp/build_8bd0cbc64dad003f3588b01ead189e3c/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:64:in 'block (2 levels) in define' remote: Tasks: TOP => environment remote: (See full trace by running task with --trace) remote: ! remote: ! Precompiling assets failed. remote: ! remote: remote: ! Push rejected, failed to compile Ruby app remote: remote: Verifying deploy... remote: remote: ! Push rejected to powerful-taiga-2060. remote: To https://git.heroku.com/powerful-taiga-2060.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/powerful-taiga-2060.git` 

Aquí está mi Gemfile:

 source 'https://rubygems.org' gem 'rails', '4.2.0.rc3' group :development do gem 'sqlite3' end group :production do gem 'pg' gem 'rails_12factor' end gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.1.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc group :development, :production, :test do gem 'byebug' gem 'web-console', '~> 2.0' gem 'spring' gem 'bootstrap-generators', '~> 3.3.1' gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git' gem 'rails_admin' gem 'mocha' gem 'nifty-generators' gem 'jquery-turbolinks' gem 'devise' end 

El problema debe ser con los rake assets:precompile . ¿Alguien podría ayudarme? El problema realmente ralentiza mi Rails Adventure.

Ninguna de las gems en tu

 group :development, :production, :test do 

fueron instalados en base a los loggings de Heroku. Intenta ponerlos fuera del grupo.

Hace un time también tuve este problema donde sucedió lo siguiente:

 git push origin master To https://github.com/Joey-project/project.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Joey-project/project.git' 

Creo que una de las principales razones de esto es porque uno no debe empujar su twig a una twig remota actualizada.

Una solución general es usar algo similar como:

 git fetch origin; git merge origin/master 

¡El código push to heroku no funciona también me dio una gran idea sobre cómo abordarlo!

Editar: elimine Devise del grupo ": development,: production,: test:" ya que Heroku no va a instalar nada en el grupo de desarrollo o testing:

 gem 'devise' 

Después de eso, ve al directory raíz de tu proyecto y hazlo

 git add . 

poner los cambios en la queue Entonces corre

 git commit -m "adds devise to gemfile" 

para agregar los cambios a sus loggings de commit. Entonces corre

 git push heroku master 

Y todo debería funcionar