문제

I am using Rails 3.1.1 and active_admin gem. Everything is running perfect in Development env but when I try to do rake db:migrate in Production env I get this error

   uninitialized constant Sass::Rails::SassTemplate

What might be the issue and how do I fix it?

In my gemfile i have gem 'sass-rails', '~> 3.1.4'

도움이 되었습니까?

해결책

would either of these two github issues relate to your problem? I see they're submitted by the same person, but they may receive different replies.

다른 팁

The answer by Spencer gives the right solution. But to avoid you to look at the two issues in GitHub and wondering which of the multiple propositions work -pushing to production just to test this can be tedious-, let me explicit the fix:

The sass-rails gem must be taken out of the :assets group:

gem 'sass-rails'

gem 'activeadmin' # (sass-rails must be loaded before!)
  gem 'meta_search',    '>= 1.1.1'
#end

group :assets do
  # Remove the line gem 'sass-rails' from here
end

As activeadmin uses sass, I assumed the sass line must appear before activeadmin. But I did not test the other way.

In case anyone wonders, the indentation of the meta_search line and the #end is just my way of remembering why I added this other gem. Just a hint to my future self that if I remove the gem activeadmin, there is a high chance that I can also remove the gem meta_search.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top