尝试推送到heroku时,获取“预编译资产失败”。

时间:2020-05-07 23:29:21

标签: ruby-on-rails ruby git heroku rubygems

最初,我遇到了一些纱线问题,这些问题已消除。 然后我已经将rails升级到了最新版本6.0.2.2 而且仍然无法正常工作。

remote:        Removing bundler (2.0.2)
remote:        Bundle completed (39.19s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v10.15.3-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        /tmp/build_25022c90f61399230fca098f2d1d781e/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/option_merger.rb:24: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
remote:        /tmp/build_25022c90f61399230fca098f2d1d781e/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/class/attribute.rb:87: warning: The called method `class_attribute' is defined here
remote:        DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
remote:        now accept two parameters, the view object and the source for the view object.
remote:        Change:
remote:          >> Coffee::Rails::TemplateHandler.call(template)
remote:        To:
remote:          >> Coffee::Rails::TemplateHandler.call(template, source)
remote:         (called from <top (required)> at /tmp/build_25022c90f61399230fca098f2d1d781e/Rakefile:6)
remote:        config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
remote:        
remote:          * development - set it to false
remote:          * test - set it to false (unless you use a tool that preloads your test environment)
remote:          * production - set it to true
remote:        
remote:        /tmp/build_25022c90f61399230fca098f2d1d781e/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/stack.rb:37: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
remote:        /tmp/build_25022c90f61399230fca098f2d1d781e/vendor/bundle/ruby/2.7.0/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/static.rb:110: warning: The called method `initialize' is defined here
remote:        I, [2020-05-07T23:20:06.410787 #1228]  INFO -- : Writing /tmp/build_25022c90f61399230fca098f2d1d781e/public/assets/application-b8709b2dcb190c854727c34d45ec6243556029204c4461bd9b87adc5a42cdb9b.js
remote:        I, [2020-05-07T23:20:06.411224 #1228]  INFO -- : Writing /tmp/build_25022c90f61399230fca098f2d1d781e/public/assets/application-b8709b2dcb190c854727c34d45ec6243556029204c4461bd9b87adc5a42cdb9b.js.gz
remote:        rake aborted!

然后:

Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote: 
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 

有什么建议吗? 谢谢

1 个答案:

答案 0 :(得分:0)

尝试在本地rake assets:precompile上编译资产,提交更改并再次推送