New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't dump anonymous class #242
Comments
Can you please provide a sample application that reproduces the error? |
Of course, here you are Hope it helps |
The problem is the file system importer, it is not serializable using Related: sass/sass#1372 Importers need to be serializable since sass 3.3 (https://github.com/sass/sass/blob/adc12b9a360f62871d7ec115a3f0d62309da32c5/lib/sass/importers/base.rb#L17) Looks like this will be hard to fix. Perhaps providing custom |
I have a workaround. I have no idea if I broke sourcemaps by doing this, I just wanted the warnings to stop because they were slowing down Sass considerably. # config/initializers/shut_up_sass.rb
module Sass
module Rails
class SassImporter < Sass::Importers::Filesystem
def marshal_dump
# Return some kind of unique fingerprint to Sass
@_marshal_id ||= object_id.to_s(16)
end
def marshal_load(*args)
# Do nothing, we don't actually care if this is Marshalable
end
end
end
end |
@csuhta - monkey patch works for me (in dev)! Thanks! Hope this gets fixed for real! |
(just for the record, this problem also occurs with sass-rails 4.0.3 apparently (c.f. #243)) |
Just wanted to chime in and say I have this issue when running locally as well. Rails 4.2 beta |
I'm having the same issue after upgrading to Rails 3.2.21 from Rails 3.1.12. Relevant Gemfile.lock:
In Heroku I get output like this:
|
Fixed on 4.0.5 |
Is this really fixed on "4.0.5"? I want to test it, but sass-rails 4.0.5 requires sass ~> 3.2.2 where the problem never existed in the first place. |
I agree. @rafaelfranca Can you point to the commit that fixed this? |
Likewise. I can't upgrade to sass-rails 4.0.5 to fix this issue when moving to Rails 3.2.21 because that version of rails uses an earlier version of railsties:
Is it possible to issue this patch to earlier versions of sass-rails so that people do not face this issues when trying to upgrade to Rails 4? We're anticipate lot of issues with people moving to Rails 4 if they encounter this issue with sass-rails when upgrading to Rails 3.2.x. |
@KelseyDH Rails 3.2 is not supported. I can only suggest you use a more consistent set of versions: if you're using a relatively ancient rails, you probably want correspondingly-old versions of sass, sass-rails, sprockets, etc. |
Thanks for responding. For Rails3.2.x can you point to a stable combination of these gem sets? Reading through issues this problem appears to have come and gone through various versions of sass, sprockets, and sass-rails. Finding the right combination of correspondingly-old sass-rails & sprockets versions to avoid this issue has proven difficult. When I follow Upgrade Guides using the recommended sass-rails versions this breaks. Upgrading to Rails3.2.17 (official recommended), Rails3.2.18 (edge upgrade recommended) & Rails3.2.21(latest release) all produce this issue. I understand you do not support older sass-rails versions; but having a cogent path for Rails3.1.x apps to upgrade sass-rails with sprockets is a necessity if apps with production requirements are going to have hope of keeping up-to-date with new versions. (This 'relatively ancient' app only went into production 3 years ago... to have this type of instability so soon is exactly what causes enterprise environments to get spooked away from Rails). If I or another person finds the right combination of safe versions I'll post it. Updating the rails upgrade guides with the new gemsets would be a good idea. For posterity here are relevant sections of my Gemfile.lock involving sprockets, railties, sass, sass-rails and dalli after upgrading to Rails 3.2.17 that generates the "can't dump anonymous class" issue when pushed to heroku:
|
Firstly: if the published Maintenance Policy is unacceptable to anyone, "enterprise environment" or otherwise, they should generally either 1) use something else, 2) pay someone to provide extended support, or 3) accept the risks, and wear the consequences, of deliberately running unsupported software. An implication of "we/others may use something else instead" fundamentally misapprehends the nature of a freely provided open source project. Despite the above, I'll go ahead and re-answer your question:
(subtle emphasis added) I can't give you an exact set of versions, but I would expect you to have better luck if you use the latest available point-release of the release series that was current when Rails 3.2.0 was released, instead of a week-old release of a series that didn't exist until several months after Rails 3.2 became unsupported. Versions newer than that may work, or may not. I'll separately look into a suitable change to the upgrade guide... I'm not sure why we'd still [attempt to] document that at all. |
@matthewd Thank you for replying. I applied your advice, it's now working! As you recommended I updated my gemfile to specify the
With this changed Gemfile I ran The It might be a good idea in the Rails 3.2.x upgrade guides to specify The second option, of specifying PS: I understand the difficulties of maintaining open source projects in older versions -- I am only relaying a sentiment that other developers give me about trusting Rails for future projects when they hear about these issues. Where I can I will make my own contributions where I can. I appreciate immensely the (unpaid) time maintainers such as yourself give to our issues. |
@KelseyDH I'm glad you found a working solution.
That is because the old sass-rails gem only specified a minimum version of sass. You were probably looking at the source of the current version. If you look at the source of the old version, you can find the older and less restrictive dependency (https://github.com/rails/sass-rails/releases/tag/v3.2.6) By using an older version of sass-rails you always got the latest version of sass.
I understand your frustration, but that is just FUD. Your problem was - as @matthewd said and you just verified - a dependency problem. Name one enterprise framework which hadn't had those. (Maven anyone?) |
It looks like it is really fixed now. I tested Rails 4.2.0.rc2 using the master branch of sass-rails and it works. Looks like #292 did the job. 👍 |
Hi!
I'm playing around with Rails 4.2 beta, and on my development environment everything works fine.
But when trying to deploy it to Heroku it throws the following warnings:
I'm using
sass-rails (5.0.0.beta1)
as it is added to the Gemfile by default with Rails 4.2 beta.What can be going wrong?
Thanks in advance :)
The text was updated successfully, but these errors were encountered: