问题描述
本地一切正常,但推向Heroku时:
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_carousel.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_hero-unit.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_utilities.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/exams.css.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/home.css.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/lessons.css.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/questions.css.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/scaffolds.css.scssc:无法转储匿名类#< Class:0x007f2583f02288>
警告。保存缓存时遇到错误/tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/sections.css.scssc:无法转储匿名类#< Class:0x007f2583f02288>
最后我得到:
警告。保存缓存时遇到错误/tmp/build_ccaceaf0-2d8f-4d84-8284-9f5fcb7ced3f/tmp/cache/sass/6b13061e65d1f1cd905accb7f7211a333a70c956/sections.css.scssc:无法转储匿名类#< Class:0x007f02dbceaa88>
DEPRECATION警告:您在供应商/插件中使用Rails 2.3式插件!在Rails 4.0中将会删除对这些插件的支持。将它们移出并将它们捆绑到Gemfile中,或者将它们作为lib / myplugin / *和config / initializers / myplugin.rb折叠到您的应用程序中。有关更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released。 (在/ tmp / build_ccaceaf0-2d8f-4d84-8284-9f5fcb7ced3f / Rakefile中从< top(required)> 7)
DEPRECATION警告:您在供应商/插件中有Rails 2.3风格的插件!在Rails 4.0中将会删除对这些插件的支持。将它们移出并将它们捆绑到Gemfile中,或者将它们作为lib / myplugin / *和config / initializers / myplugin.rb折叠到您的应用程序中。有关更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released。 (在/ tmp / build_ccaceaf0-2d8f-4d84-8284-9f5fcb7ced3f / Rakefile中从< top(required)>调用)7)
!超时编译Ruby应用程序(15分钟)
!请参阅https://devcenter.heroku.com/articles/slug-compiler#time-limit
我
我的gemfile:
ruby'2.0.0'
gem'rails','3.2.11'
group:assets do
gem'sass-rails'#,'〜> 3.2.3'
gem'咖啡栏','〜> 3.2.1'
gem'uglifier','> = 1.0.3'
end
gem'jquery-rails'
gem'bootstrap-sass'#,'2.3 .2.0'
gem'cancan'
gem'devise'
gem'figaro'
gem'haml-rails'
gem'mongoid'
gem 'rolify'
gem'simple_form'
gem'thin'
gem'country_select'
group:development do
gem'better_errors'
gem'binding_of_caller '::platforms => [:mri_19,:rbx]
gem'guard-bundler'
gem'guard-rails'
gem'guard-rspec'
gem' html2haml'
gem'quiet_assets'
gem'rb-fchange',:require => false
gem'rb-fsevent',:require => false
gem' rb-inotify'::require => false
gemswitch_user
end
group:development,:test do
gem'factory_girl_rails'
gem'rspec -rails'
end
group:test do
gem'database_cleaner'
gem'email_spec'
gem 'mongoid-rspec'
end
gemckeditor
#gembinding_of_caller
gemmongoid-paperclip,:require => mongoid_paperclip,::git =>'https://github.com/meskyanichi/mongoid-paperclip'
gem'aws-sdk','〜> 1.3.4'
gemflat-ui-rails
gem'stripe',:git => 'https://github.com/stripe/stripe-ruby'
gemmongoid_slug,〜> 2.0.1
我的production.rb文件启用了以下属性:
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.assets.compress = true
config.assets.compile = false
config.assets.digest = true
config.assets.initialize_on_precompile = false
我的Rails版本是Rails 3.2.11
解决方案这与sass gem最近升级到3.3.0有关。 sass gem是一些其他sass gems的依赖项,所以即使你没有在你的Gemfile中,它也可能被加载。在本地和Heroku上进行捆绑秀,我相当肯定你会看到他们是不同的版本(几天前sass升级到3.3.0)。
Add:
gem'sass','3.2.13'
添加到您的Gemfile,并且应该为您解决问题。然后在github上为这个宝石提交一个问题。
希望这会有帮助,它对我有用!
Everything works fine locally, but when pushing to Heroku:
Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_carousel.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_hero-unit.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/bc1b787c8640c68bf42fc69efbef227d36428060/_utilities.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/exams.css.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/home.css.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/lessons.css.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/questions.css.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/scaffolds.css.scssc: can't dump anonymous class #<Class:0x007f2583f02288> Warning. Error encountered while saving cache /tmp/build_1b5c442a-d24e-4f80-9755-a0bd15d7f029/tmp/cache/sass/5b1569a9810eac207f22942f2921f0820863a2d6/sections.css.scssc: can't dump anonymous class #<Class:0x007f2583f02288>
Eventually I get:
Warning. Error encountered while saving cache /tmp/build_ccaceaf0-2d8f-4d84-8284-9f5fcb7ced3f/tmp/cache/sass/6b13061e65d1f1cd905accb7f7211a333a70c956/sections.css.scssc: can't dump anonymous class #<Class:0x007f02dbceaa88> DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_ccaceaf0-2d8f-4d84-8284-9f5fcb7ced3f/Rakefile:7) DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_ccaceaf0-2d8f-4d84-8284-9f5fcb7ced3f/Rakefile:7) ! Timed out compiling Ruby app (15 minutes) ! See https://devcenter.heroku.com/articles/slug-compiler#time-limit
I've only pasted a fraction of the number of times this appears.
My gemfile:
ruby '2.0.0' gem 'rails', '3.2.11' group :assets do gem 'sass-rails' #, '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' end gem 'jquery-rails' gem 'bootstrap-sass'#, '2.3.2.0' gem 'cancan' gem 'devise' gem 'figaro' gem 'haml-rails' gem 'mongoid' gem 'rolify' gem 'simple_form' gem 'thin' gem 'country_select' group :development do gem 'better_errors' gem 'binding_of_caller', :platforms=>[:mri_19, :rbx] gem 'guard-bundler' gem 'guard-rails' gem 'guard-rspec' gem 'html2haml' gem 'quiet_assets' gem 'rb-fchange', :require=>false gem 'rb-fsevent', :require=>false gem 'rb-inotify', :require=>false gem "switch_user" end group :development, :test do gem 'factory_girl_rails' gem 'rspec-rails' end group :test do gem 'database_cleaner' gem 'email_spec' gem 'mongoid-rspec' end gem "ckeditor" #gem "binding_of_caller" gem "mongoid-paperclip", :require => "mongoid_paperclip", :git=>'https://github.com/meskyanichi/mongoid-paperclip' gem 'aws-sdk', '~> 1.3.4' gem "flat-ui-rails" gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby' gem "mongoid_slug", "~> 2.0.1"
My production.rb file has the following properties enabled
config.cache_classes = true config.consider_all_requests_local = false config.action_controller.perform_caching = true config.serve_static_assets = true config.assets.compress = true config.assets.compile = false config.assets.digest = true config.assets.initialize_on_precompile = false
My rails version is Rails 3.2.11
解决方案This is related to the recent upgrade of the sass gem to 3.3.0. The sass gem is a dependency of a couple of other sass gems, so even if you don't have it in your Gemfile, it is probably getting loaded. Do a "bundle show" locally and on Heroku and I'm fairly sure you'll see they are different versions (sass was upgraded to 3.3.0 just a couple days ago).
Add:
gem 'sass', '3.2.13'
to your Gemfile and that should fix things for you. Then go submit an issue on github for this gem.
Hope this helps, it worked for me!
这篇关于Heroku:保存缓存时遇到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!