undefined method `sass' for #<Rails::Application::Configuration:0x1cf3338> on Staging

匿名 (未验证) 提交于 2019-12-03 07:50:05

问题:

I am trying to deploy my aplication on server and using staging environment . But its keep giving me this error on staging environment .

undefined method `sass' for #Rails::Application::Configuration:0x1cf3338

On my development environment local its working fine. In my application i am using the compass and susy framework , my Gemfile look like this https://gist.github.com/2003755

I am trying it to configure this from past 2 days , but still not find a way to make it work . Previously this configuration is working fine . Suddenly after my last deployment every thing broke down . Thanks

回答1:

If you're configuring sass from your application.rb then although the sass stuff is only used for asset precompilation (which I presume you are using) Rails will always try and configure sass.

Since in staging the app boots without the assets group loaded, sass-rails isn't loaded and so everything falls over. You could either move sass-rails to the main bit of your gemfile, or possibly bracket the bit of your application.rb which configures sass with

if defined?(Sass)   ... end


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