Sass or Foundation Error after updating Rails and other gems

依然范特西╮ 提交于 2019-12-07 09:27:56

问题


I have recently updated rails and some other gems. However now I get the following error:

Sass::SyntaxError at / Mixin "exports" does not accept a content block. (in /Users/mikhailja/Sites/marketing/app/assets/stylesheets/application.css.scss:341)

I'm using:

  • ruby 2.1.2
  • rails 4.1.8
  • sass 3.2.2
  • sass-rails 2.0.0
  • foundation-rails 5.4.5.0

The problem went away for a while after trying numerous gem versions but now all of a sudden its back after getting a stack level too deep error.

I've tried the same version of foundation in a new app and it works perfectly.

Any help to get to the bottom of this problem would be very much appreciated.


回答1:


According to the Foundation github repo, it has to do with a Rails and Sass compatibility issue, which creates a Foundation compatibility issue because of their codebase. Apparently sass-rails has been recently updated to deal with this, and should solve the issue, but I'm not seeing any updates when I update my gems, so best way to deal with it now is probably to downgrade.

Edit: figured it out. In your Gemfile delete the specified version of sass-rails that's autogenerated then run update and you'll get the newest version which will work with the newest version of foundation.




回答2:


I found a solution. Here is what I did for anyone else experiencing this problem:

  1. Downgraded foundation-rails gem to version 5.1.1.0 (this was my original version) at this point my rails server would not start properly.

  2. Then updated foundation-rails to version 5.3.0.0

I'm not sure if there was just a gem version compatibility issue or if the downgrade/upgrade made the difference.

Anyway, now everything works and my tests are passing!



来源:https://stackoverflow.com/questions/27126235/sass-or-foundation-error-after-updating-rails-and-other-gems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!