本文介绍了#<Rails::Application::Configuration:0x1cf3338>的未定义方法`sass'分期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在服务器上部署我的应用程序并使用登台环境.但是它在登台环境中不断给我这个错误.

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

#Rails::Application::Configuration:0x1cf3338 的未定义方法 `sass'

在我的开发环境 本地 上它工作正常.在我的应用程序中,我使用了指南针和 susy 框架,我的 Gemfile 看起来像这样https://gist.github.com/2003755

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

我正在尝试从过去 2 天开始对其进行配置,但仍然没有找到使其工作的方法.以前这个配置工作正常.在我最后一次部署之后,突然间一切都崩溃了.谢谢

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

推荐答案

如果您从 application.rb 配置 sass,那么尽管 sass 内容仅用于资产预编译(我认为您正在使用)Rails 将始终尝试配置 sass.

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.

由于暂存应用程序在没有加载资产组的情况下启动,sass-rails 没有加载,所以一切都失败了.您可以将 sass-rails 移动到您的 gemfile 的主要位,或者可能将您的 application.rb 的位括起来,它使用

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

这篇关于#<Rails::Application::Configuration:0x1cf3338>的未定义方法`sass'分期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 12:33