gpt4 book ai didi

ruby-on-rails - Heroku 推送错误 : "NameError: uninitialized constant Uglifier::VERSION" on rake assets:precompile

转载 作者:数据小太阳 更新时间:2023-10-29 06:58:25 26 4
gpt4 key购买 nike

我在尝试推送到生产环境时收到以下错误。这是推送的结果:

$ git push production master
Counting objects: 124, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (118/118), done.
Writing objects: 100% (124/124), 19.73 KiB | 0 bytes/s, done.
Total 124 (delta 66), reused 1 (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.2.2
remote: -----> Installing dependencies using 1.9.7
remote: Ruby version change detected. Clearing bundler cache.
remote: Old: ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-linux]
remote: New: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Fetching gem metadata... <omitted>
remote: Installing... <omitted>
remote: Bundle complete! 33 Gemfile dependencies, 70 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.

...<misc post install notifications omitted>...

remote: Bundle completed (93.05s)
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 Uglifier::VERSION
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/uglifier_compressor.rb:48:in `initialize'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/uglifier_compressor.rb:24:in `new'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/uglifier_compressor.rb:24:in `instance'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/uglifier_compressor.rb:28:in `call'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:86:in `load_asset_by_uri'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:45:in `block in load'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:156:in `fetch_asset_from_dependency_cache'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:38:in `load'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/cached_environment.rb:47:in `yield'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/cached_environment.rb:47:in `load'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/base.rb:63:in `find_asset'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/base.rb:70:in `find_all_linked_assets'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/manifest.rb:138:in `block in find'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:223:in `block in stat_tree'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:207:in `block in stat_directory'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:204:in `each'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:204:in `stat_directory'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:222:in `stat_tree'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:105:in `each'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:104:in `each'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:104:in `logical_paths'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/manifest.rb:136:in `find'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/sprockets/manifest.rb:162:in `compile'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-3.1.0/lib/rake/sprocketstask.rb:147:in `with_logger'
remote: /tmp/build_1185918c8fd4fbf904b3d7c2f09505d5/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app

最佳答案

问题似乎是 Sprockets 3.1 与我使用的 Uglifier 压缩器版本 2.1 之间的不兼容。通过将此行放入我的 Gemfile 来升级 Uglifier 解决了这个问题:

gem 'uglifier', '~> 2.7'

关于ruby-on-rails - Heroku 推送错误 : "NameError: uninitialized constant Uglifier::VERSION" on rake assets:precompile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30338860/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com