Skip to content
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

uninitialized constant Sass::Rails::SassTemplate in production #38

Closed
szymon-przybyl opened this issue Sep 1, 2011 · 21 comments
Closed

Comments

@szymon-przybyl
Copy link

After migrating from Rails 3.0.10 to 3.1.0 i get this error on my production server (in development app works ok):

gems/sass-rails-3.1.0/lib/sass/rails/railtie.rb:38:in `block in <class:Railtie>': uninitialized constant Sass::Rails::SassTemplate (NameError)
@chriseppstein
Copy link
Contributor

Gemfile?

Hunt & pecked on my iPhone... Sorry if it's brief!

On Sep 1, 2011, at 11:33 AM, apocalyptiqreply@reply.github.com wrote:

After migrating from Rails 3.0.10 to 3.1.0 i get this error on my production server (in development app works ok):

gems/sass-rails-3.1.0/lib/sass/rails/railtie.rb:38:in `block in class:Railtie': uninitialized constant Sass::Rails::SassTemplate (NameError)

Reply to this email directly or view it on GitHub:
#38

@szymon-przybyl
Copy link
Author

I have sass-rails '~> 1.3.0' in my Gemfile in :assets group, and i've ran there "bundle install"

@chriseppstein
Copy link
Contributor

This error is almost certainly a configuration issue. Please post the steps required to reproduce it exactly.

Hunt & pecked on my iPhone... Sorry if it's brief!

On Sep 1, 2011, at 11:48 AM, apocalyptiqreply@reply.github.com wrote:

I have sass-rails '~> 1.3.0' in my Gemfile in :assets group, and i've ran there "bundle install"

Reply to this email directly or view it on GitHub:
#38 (comment)

@szymon-przybyl
Copy link
Author

actually i have sass-rails '~> 3.1.0', my mistake :)

so why that error is occuring?

@szymon-przybyl
Copy link
Author

that's actually some problem with active_admin:
gems/ruby-1.9.2-p290@farmera/bundler/gems/active_admin-d6293514b99d/lib/active_admin/sass/helpers.rb:3:in `<top (required)>'

helpers.rb:3 :
require 'sass-rails' if ActiveAdmin::DependencyChecker.rails_3_1?

any ideas how to fix it?

the same issue in active_admin: activeadmin/activeadmin#447

@chriseppstein
Copy link
Contributor

how can I fix it when you still have not provided steps to reproduce it?

@szymon-przybyl
Copy link
Author

Install Rails 3.1 with activeadmin from github and try to run it in production.

@tracedwax
Copy link

To work around this, just move gem 'sass-rails' out of the group 'assets', which doesn't get loaded before ActiveAdmin.

@szymon-przybyl
Copy link
Author

Thanks a lot tracedwax, that fixed it!

@avocade
Copy link

avocade commented Sep 26, 2011

This issue is back in 3-1-stable, not using active_admin or anything fancy. Have to move it out of the :assets group for it to not complain on assets:precompile. Worked fine in 3.1.0.

@joemsak
Copy link

joemsak commented Nov 21, 2011

I already have sass-rails in my :assets group and still get this error

I tried changing my heroku config RAILS_ENV and RACK_ENV from staging to production but that didn't do it either

Any clues? Thanks!

@szymon-przybyl
Copy link
Author

@joemsak , so as @tracedwax said, move your sass-rails out of assets group, just instead of:

group :assets do
  gem 'sass-rails'
end

do:

gem 'sass-rails'

@joemsak
Copy link

joemsak commented Nov 21, 2011

Oh. My bad. I read that as "in to", somehow

Sorry!

On Nov 21, 2011, at 2:55 AM, Szymon Przybyłreply@reply.github.com wrote:

@joemsak , so as @tracedwax said, move your sass-rails out of assets group, just instead of:

group :assets do
gem 'sass-rails'
end

do:

gem 'sass-rails'


Reply to this email directly or view it on GitHub:
#38 (comment)

@joemsak
Copy link

joemsak commented Nov 21, 2011

Wow, talk about reading comprehension! Sometimes the brain just doesn't function right when you're trying to push a demo out for a client and you start getting errors on your deploy! That worked for me, thanks again!

@benmort
Copy link

benmort commented Dec 13, 2011

thanks tracedwax, worked for me! was having such a headache on heroku

@tracedwax
Copy link

Glad to hear!

On Tue, Dec 13, 2011 at 1:07 AM, stringpane <
reply@reply.github.com

wrote:

thanks tracedwax, worked for me! was having such a headache on heroku


Reply to this email directly or view it on GitHub:
#38 (comment)

@firman
Copy link

firman commented Jan 18, 2012

sip

@constantm
Copy link

I had this issue when trying to run rake db:migrate on Heroku. It did however work locally. Moving gem gem 'sass-rails', " ~> 3.1.0" out of assets in the Gemfile fixed the issue.

@pcastellazzi
Copy link

I think this should be reopen, moving sass-rails outside the assets groups is not a solution is a workaround. May be i am missing something. What's the reason for it to be needed in production?

@chriseppstein chriseppstein reopened this Jan 25, 2012
@pcastellazzi
Copy link

The ActiveAdmin issue is not related to sass-rails. I posted a possible solution to it as a comment to #GH-447

@chriseppstein
Copy link
Contributor

Thanks. Closing again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants