ruby-on-rails – 部署到Heroku时未定义的mixin’global-reset’

ruby-on-rails – 部署到Heroku时未定义的mixin’global-reset’,第1张

概述任何想法为什么在部署到Heroku时会发生这种情况: -----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! Undefined mixin 'global-reset'. (in /tmp/build_b4afrg 任何想法为什么在部署到Heroku时会发生这种情况:

-----> Preparing app for Rails asset pipeline       Running: rake assets:precompile       rake aborted!       Undefined mixin 'global-reset'.       (in /tmp/build_b4afrg7i0afu/vendor/bundle/ruby/1.9.1/gems/activeadmin-0.3.4/app/assets/stylesheets/active_admin/_base.CSS.sCSS)       Tasks: top => assets:precompile:primary       (See full trace by running task with --trace)       Precompiling assets Failed,enabling runtime asset compilation       Injecting rails31_enable_runtime_asset_compilation

我有一个sCSS文件:

@import "compass/reset";

但为什么在编制资产时却找不到它呢?有没有办法不编译它们?它在运行时工作正常,这一步产生一个异常进入空气制动器,这很痛苦.

更新:我运行rake资产:在本地预编译,我发现错误似乎是由activeadmin生成的:

$rake assets:precompile --trace** Invoke assets:precompile (first_time)** Execute assets:precompile/Users/pupeno/.rvm/rubIEs/ruby-1.9.2-p290/bin/ruby /Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace** Invoke assets:precompile:all (first_time)** Execute assets:precompile:all** Invoke assets:precompile:primary (first_time)** Invoke assets:environment (first_time)** Execute assets:environment** Invoke environment (first_time)** Execute environment** Invoke tmp:cache:clear (first_time)** Execute tmp:cache:clear** Execute assets:precompile:primaryrake aborted!Undefined mixin 'global-reset'.  (in /Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/activeadmin-0.4.0/app/assets/stylesheets/active_admin/_base.CSS.sCSS)/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/activeadmin-0.4.0/app/assets/stylesheets/active_admin/_base.CSS.sCSS:4:in `global-reset'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/activeadmin-0.4.0/app/assets/stylesheets/active_admin/_base.CSS.sCSS:4/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:170:in `visit_mixin'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `visit'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:18:in `visit'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `map'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `visit_children'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:39:in `with_environment'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:26:in `visit_children'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `block in visit'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:47:in `visit_root'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `visit'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:18:in `visit'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:7:in `visit'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/tree/root_node.rb:20:in `render'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/engine.rb:300:in `_render'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sass-3.1.12/lib/sass/engine.rb:247:in `render'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/@R_301_3642@-3.1.5/lib/sass/rails/template_handlers.rb:95:in `evaluate'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/context.rb:175:in `block in evaluate'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in `each'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in `evaluate'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:171:in `build_dependency_context_and_body'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:135:in `dependency_context'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in `build_dependencIEs_paths_and_assets'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:141:in `dependency_paths'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:61:in `mtime'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/asset.rb:58:in `block in encode_with'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/asset.rb:57:in `each'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/asset.rb:57:in `encode_with'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:43:in `encode_with'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/caching.rb:52:in `cache_asset'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:67:in `block in build_asset'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:76:in `memoize'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:65:in `build_asset'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/trail.rb:102:in `find_asset_in_path'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:101:in `find_asset'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/index.rb:48:in `find_asset'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/actionpack-3.1.3/lib/sprockets/static_compiler.rb:20:in `block in compile'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:151:in `block in each_logical_path'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:139:in `block (2 levels) in each_file'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:129:in `each'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:129:in `each_entry'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:137:in `block in each_file'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:136:in `each'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:136:in `each_file'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/sprockets-2.0.3/lib/sprockets/base.rb:149:in `each_logical_path'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/actionpack-3.1.3/lib/sprockets/static_compiler.rb:18:in `compile'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/actionpack-3.1.3/lib/sprockets/assets.rake:52:in `internal_precompile'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/actionpack-3.1.3/lib/sprockets/assets.rake:66:in `block (3 levels) in <top (required)>'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'/Users/pupeno/.rvm/rubIEs/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/actionpack-3.1.3/lib/sprockets/assets.rake:56:in `block (3 levels) in <top (required)>'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'/Users/pupeno/.rvm/rubIEs/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/bin/rake:19:in `load'/Users/pupeno/.rvm/gems/ruby-1.9.2-p290@watu/bin/rake:19:in `<main>'Tasks: top => assets:precompile:primaryrake aborted!

I reported this issue in case it’s a bug.

解决方法 检查您是否执行了以下所有 *** 作:

在config / application.rb中,确保您拥有以下行:

config.assets.initialize_on_precompile = false

如果您正在加载application.CSS以外的sCSS文件,请确保它们包含在资产管道中.您需要在文件顶部的以下行:

/ * = require_self * /

除#2之外,在config / environments / production.rb中,将这些文件添加到资源列表中.例如,如果您的文件是my.sCSS,则需要以下行:

config.assets.precompile =%w(my.CSS)

最后,http://guides.rubyonrails.org/asset_pipeline.html有一个很棒的指南

总结

以上是内存溢出为你收集整理的ruby-on-rails – 部署到Heroku时未定义的mixin’global-reset’全部内容,希望文章能够帮你解决ruby-on-rails – 部署到Heroku时未定义的mixin’global-reset’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1274216.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存