Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Warning. Error encountered while saving cache ... can't dump anonymous class" Update? [duplicate]

When app is deployed with capistrano errors occur in production.log.

Compiled signup.css  (30ms)  (pid 31797)
Warning. Error encountered while saving cache /home/deployer/apps/example.com/releases/20140315211501/tmp/cache/sass/c76a96d592cb37dc7092a4e2f10ad8d3d22bcc8b/user_sessions.css.scssc: can't dump anonymous class #<Class:0x0000000356d120>

Compiled user_sessions/user_sessions.css  (16ms)  (pid 31797)
Compiled user_sessions.css  (20ms)  (pid 31797)
Warning. Error encountered while saving cache /home/deployer/apps/example.com/releases/20140315211501/tmp/cache/sass/a59f84087c66a48b1521281da138ce9e3ed4c217/welcome.css.scssc: can't dump anonymous class #<Class:0x0000000356d120>

This is Gemfile.lock I am using.

GIT
  remote: git://github.com/tomazzlender/letter_opener.git
  revision: 29b17fefe87b8fdc7ead987dbfabe355b59ff684
  specs:
    letter_opener (0.0.2)
      launchy

GIT
  remote: git://github.com/tomazzlender/premailer.git
  revision: 88af5e6f60ac78ef1d70d6f0a6f4b7612d2c5f7a
  specs:
    premailer (1.7.3)
      css_parser (>= 1.1.9)
      htmlentities (>= 4.0.0)

GIT
  remote: git://github.com/tomazzlender/snapshot.git
  revision: 0f0f3fd024bf5a3a846e999b845803ae61d870c0
  specs:
    snapshot (1.1.0)

GIT
  remote: https://github.com/37signals/mail_view.git
  revision: c8cc1315026ce85973ef56e628ac2e38a7a95563
  specs:
    mail_view (1.0.1)
      tilt

GIT
  remote: https://github.com/thoughtbot/capybara-webkit.git
  revision: 11c596f7a06dbda123c077440f9275905f89e869
  specs:
    capybara-webkit (0.13.0)
      capybara (>= 2.0.1)
      json

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.17)
      actionpack (= 3.2.17)
      mail (~> 2.5.4)
    actionpack (3.2.17)
      activemodel (= 3.2.17)
      activesupport (= 3.2.17)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    active_attr (0.7.0)
      activemodel (>= 3.0.2, < 4.1)
      activesupport (>= 3.0.2, < 4.1)
    activemodel (3.2.17)
      activesupport (= 3.2.17)
      builder (~> 3.0.0)
    activerecord (3.2.17)
      activemodel (= 3.2.17)
      activesupport (= 3.2.17)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.17)
      activemodel (= 3.2.17)
      activesupport (= 3.2.17)
    activesupport (3.2.17)
      i18n (~> 0.6, >= 0.6.4)
      multi_json (~> 1.0)
    addressable (2.2.7)
    ansi (1.4.3)
    arel (3.0.3)
    authlogic (3.1.0)
      activerecord (>= 3.0.7)
      activerecord (>= 3.0.7)
    builder (3.0.4)
    capistrano (2.9.0)
      highline
      net-scp (>= 1.0.0)
      net-sftp (>= 2.0.0)
      net-ssh (>= 2.0.14)
      net-ssh-gateway (>= 1.1.0)
    capybara (2.0.2)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      selenium-webdriver (~> 2.0)
      xpath (~> 1.0.0)
    childprocess (0.3.6)
      ffi (~> 1.0, >= 1.0.6)
    chronic (0.6.7)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.2.0)
    css_parser (1.2.6)
      addressable
      rdoc
    erubis (2.7.0)
    eventmachine (1.0.0)
    exception_notification (3.0.0)
      actionmailer (>= 3.0.4)
      tinder (~> 1.8)
    execjs (1.3.0)
      multi_json (~> 1.0)
    faraday (0.8.4)
      multipart-post (~> 1.1)
    faraday_middleware (0.9.0)
      faraday (>= 0.7.4, < 0.9)
    ffi (1.2.0)
    hashie (1.2.0)
    highline (1.6.11)
    hike (1.2.3)
    htmlentities (4.3.1)
    http_parser.rb (0.5.3)
    i18n (0.6.9)
    journey (1.0.4)
    jquery-rails (2.0.3)
      railties (>= 3.1.0, < 5.0)
      thor (~> 0.14)
    json (1.8.1)
    kgio (2.7.2)
    launchy (2.1.0)
      addressable (~> 2.2.6)
    libwebsocket (0.1.7.1)
      addressable
      websocket
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    marginalia (1.1.0)
      actionpack (>= 2.3, < 3.3)
      activerecord (>= 2.3, < 3.3)
    meta_request (0.2.1)
      rack-contrib
      rails
    mime-types (1.25.1)
    minitest (4.3.3)
    minitest-capybara (0.1.0)
      capybara (>= 1.0)
      minitest-matchers (>= 1.2)
    minitest-matchers (1.2.0)
      minitest (>= 2.5.0)
    minitest-rails (0.3)
      minitest (~> 4.0)
      rails (~> 3.0)
    minitest-rails-capybara (0.1)
      minitest-capybara (~> 0.1)
      minitest-rails (~> 0.1)
    multi_json (1.9.0)
    multipart-post (1.1.5)
    net-scp (1.0.4)
      net-ssh (>= 1.99.1)
    net-sftp (2.0.5)
      net-ssh (>= 2.0.9)
    net-ssh (2.3.0)
    net-ssh-gateway (1.1.0)
      net-ssh (>= 1.99.1)
    nokogiri (1.5.0)
    pg (0.17.1)
    polyglot (0.3.4)
    premailer-rails3 (1.3.1)
      premailer (~> 1.7)
      rails (~> 3)
    psych (1.3.4)
    quiet_assets (1.0.1)
      railties (~> 3.1)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-contrib (1.1.0)
      rack (>= 0.9.1)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.17)
      actionmailer (= 3.2.17)
      actionpack (= 3.2.17)
      activerecord (= 3.2.17)
      activeresource (= 3.2.17)
      activesupport (= 3.2.17)
      bundler (~> 1.0)
      railties (= 3.2.17)
    railties (3.2.17)
      actionpack (= 3.2.17)
      activesupport (= 3.2.17)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    raindrops (0.8.0)
    rake (10.1.1)
    rdoc (3.12.2)
      json (~> 1.4)
    ruby-ole (1.2.11.3)
    rubyzip (0.9.6.1)
    sass (3.2.6)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    selenium-webdriver (2.27.2)
      childprocess (>= 0.2.5)
      libwebsocket (~> 0.1.3)
      multi_json (~> 1.0)
      rubyzip
    sheets (1.1.0)
      nokogiri (>= 1.4.3.1)
      rubyzip (>= 0.9.4)
      spreadsheet (>= 0.6.5.2)
    simple_oauth (0.1.9)
    spreadsheet (0.6.8)
      ruby-ole (>= 1.0)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    thor (0.18.1)
    tilt (1.4.1)
    tinder (1.9.1)
      eventmachine (>= 0.12.0, < 2)
      faraday (~> 0.8)
      faraday_middleware (~> 0.8)
      hashie (~> 1.0)
      json (~> 1.6)
      mime-types (~> 1.16)
      multi_json (~> 1.0)
      multipart-post (~> 1.1)
      twitter-stream (~> 0.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    turn (0.9.6)
      ansi
    twitter-stream (0.1.16)
      eventmachine (>= 0.12.8)
      http_parser.rb (~> 0.5.1)
      simple_oauth (~> 0.1.4)
    tzinfo (0.3.39)
    uglifier (1.2.3)
      execjs (>= 0.3.0)
      multi_json (>= 1.0.2)
    unicode_utils (1.3.0)
    unicorn (4.2.0)
      kgio (~> 2.6)
      rack
      raindrops (~> 0.7)
    websocket (1.0.6)
    whenever (0.7.3)
      activesupport (>= 2.3.4)
      chronic (~> 0.6.3)
    will_paginate (3.0.3)
    xpath (1.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  active_attr
  authlogic
  capistrano
  capybara
  capybara-webkit!
  coffee-rails (~> 3.2.1)
  exception_notification (= 3.0.0)
  jquery-rails (~> 2.0.1)
  launchy
  letter_opener!
  mail_view!
  marginalia
  meta_request (= 0.2.1)
  minitest-rails
  minitest-rails-capybara
  nokogiri
  pg
  premailer!
  premailer-rails3
  psych
  quiet_assets
  rails (= 3.2.17)
  sass (= 3.2.6)
  sass-rails (~> 3.2.3)
  sheets
  snapshot!
  turn
  uglifier (>= 1.0.3)
  unicode_utils
  unicorn
  whenever
  will_paginate

What causes this errors?

like image 979
tomazzlender Avatar asked Nov 22 '22 09:11

tomazzlender


2 Answers

It is a known bug with the current release of Sass, updating the sass stylesheet will cause the caching error because of the Sprockets importer not serializing correctly. For the bug report see this.

like image 57
Jeremy Avatar answered Nov 25 '22 00:11

Jeremy


It is a bug in sprockets, but if, like me you are using an older version of Rails (3.2) you may be able to fix the bug by using a different version of sass. This guy was able to get it working with sass 3.1.x: https://github.com/rails/sass-rails/issues/242#issuecomment-66231135

The thread mentioned there gives some good context and an explanation for how to handle solving the issue or working around an inability to upgrade to a much newer, fixed version of sprockets.

Basically, use sass/sass-rails/sprockets from around the time Rails 3.2.x was supported.

like image 41
jakeonrails Avatar answered Nov 24 '22 22:11

jakeonrails