预编译资产失败,预接收挂钩拒绝

时间:2014-12-08 16:02:17

标签: ruby-on-rails git heroku

 rake aborted!                                                                                                                                                                                                                                                
remote:        NoMethodError: undefined method `configure' for #<LearnRails::Application:0x007f440b80c9c8>                                                                                                                                                                  
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/config/environments/production.rb:1:in `<top (required)>'                                                                                                                                                        
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                            
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'                                                                                                   
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'                                                                                                    
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                            
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'                                                                                                     
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:590:in `each'                                                                                                                                   
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/engine.rb:590:in `block in <class:Engine>'                                                                                                                
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `instance_exec'                                                                                                                    
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `run'                                                                                                                              
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'                                                                                                        
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:44:in `each'                                                                                                                             
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'                                                                                                                 
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:54:in `run_initializers'                                                                                                                 
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:215:in `initialize!'                                                                                                                       
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/config/environment.rb:5:in `<top (required)>'                                                                                                                                                                    
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                            
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'                                                                                                   
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'                                                                                                    
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                            
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:189:in `require_environment!'                                                                                                              
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:250:in `block in run_tasks_blocks'                                                                                                         
remote:        /tmp/build_c58e817396acd7fe215a3b1c6bf3b6a5/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'                                                                                               
remote:        Tasks: TOP => environment                                                                                                                                                                                                                                    
remote:        (See full trace by running task with --trace)                                                                                                                                                                                                                
remote:  !    

                                                                         remote: !
remote: ! Precompiling assets failed.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to learn-railsmp.
remote:
To https://git.heroku.com/learn-railsmp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/learn-railsmp.git'

我试过环顾四周并重新推送到Git,重新预编译(使用RAILS_ENV=production rake assets:precompile

我还是Rails的新手,所以我的故障排除非常有限......我不知道从哪里开始寻找超出我在此处找到的答案:

我尝试使用-f将我的提交推送到git,并尝试使用-f推送到Heroku。
我已将application.rb更新为包含此行:

config.assets.initialize_on_precompile = false

我觉得我只是在黑暗中刺伤而不知道如何解决这个问题。

进一步环顾四周,当我跑步时

RAILS_ENV=production rake assets:precompile

我明白了:

 rake aborted!                                                                                                                                                                                                                 
NoMethodError: undefined method `configure' for #<LearnRails::Application:0x000000018f85d0>                                                                                                                                                                                 
/home/action/workspace/learn-rails/config/environments/production.rb:1:in `<top (required)>'                                                                                                                                                                                
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                                                                         
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'                                                                                                                                                
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'                                                                                                                                                 
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                                                                         
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'                                                                                                                                                  
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/engine.rb:590:in `each'                                                                                                                                                                                
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/engine.rb:590:in `block in <class:Engine>'                                                                                                                                                             
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `instance_exec'                                                                                                                                                                 
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `run'                                                                                                                                                                           
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'                                                                                                                                                     
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/initializable.rb:44:in `each'                                                                                                                                                                          
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'                                                                                                                                                              
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/initializable.rb:54:in `run_initializers'                                                                                                                                                              
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/application.rb:215:in `initialize!'                                                                                                                                                                    
/home/action/workspace/learn-rails/config/environment.rb:5:in `<top (required)>'                                                                                                                                                                                            
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                                                                         
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'                                                                                                                                                
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'                                                                                                                                                 
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'                                                                                                                                                         
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/application.rb:189:in `require_environment!'                                                                                                                                                           
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.0.1/lib/rails/application.rb:250:in `block in run_tasks_blocks'                                                                                                                                                      
/home/action/.rvm/gems/ruby-2.0.0-p576/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'                                                                                                                                            
/home/action/.rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in `eval'                                                                                                                                                                                               
/home/action/.rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in `<main>'    

这有帮助吗?我还在寻找解决方案..谢谢! :)

0 个答案:

没有答案