Can't properly import partials in Sass. Rails 3.1. #2220

Closed
tallica opened this Issue Jul 23, 2011 · 2 comments

2 participants

@tallica

Steps to reproduce:

rails new testsass
cd testsass/app/assets/stylesheets/
echo "\$color: #face64" > _common.sass
echo "@import common
body
  color: \$color" > style.sass
rails s

Then go to http://localhost:3000/assets/application.css, result:

Sass::SyntaxError
Undefined variable: "$color".

Works just fine with sass command:

$ sass style.sass 
body {
  color: #face64; }
GIT
  remote: git://github.com/rails/rails.git
  revision: b2285ba1a669ff215acdd5b9082208941a621762
  branch: 3-1-stable
  specs:
    actionmailer (3.1.0.rc4)
      actionpack (= 3.1.0.rc4)
      mail (~> 2.3.0)
    actionpack (3.1.0.rc4)
      activemodel (= 3.1.0.rc4)
      activesupport (= 3.1.0.rc4)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      i18n (~> 0.6)
      rack (~> 1.3.1)
      rack-cache (~> 1.0.2)
      rack-mount (~> 0.8.1)
      rack-test (~> 0.6.0)
      sprockets (~> 2.0.0.beta.10)
    activemodel (3.1.0.rc4)
      activesupport (= 3.1.0.rc4)
      bcrypt-ruby (~> 2.1.4)
      builder (~> 3.0.0)
      i18n (~> 0.6)
    activerecord (3.1.0.rc4)
      activemodel (= 3.1.0.rc4)
      activesupport (= 3.1.0.rc4)
      arel (~> 2.1.3)
      tzinfo (~> 0.3.29)
    activeresource (3.1.0.rc4)
      activemodel (= 3.1.0.rc4)
      activesupport (= 3.1.0.rc4)
    activesupport (3.1.0.rc4)
      multi_json (~> 1.0)
    rails (3.1.0.rc4)
      actionmailer (= 3.1.0.rc4)
      actionpack (= 3.1.0.rc4)
      activerecord (= 3.1.0.rc4)
      activeresource (= 3.1.0.rc4)
      activesupport (= 3.1.0.rc4)
      bundler (~> 1.0)
      railties (= 3.1.0.rc4)
    railties (3.1.0.rc4)
      actionpack (= 3.1.0.rc4)
      activesupport (= 3.1.0.rc4)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)

GEM
  remote: http://rubygems.org/
  specs:
    ansi (1.3.0)
    arel (2.1.3)
    bcrypt-ruby (2.1.4)
    builder (3.0.0)
    erubis (2.7.0)
    hike (1.2.0)
    i18n (0.6.0)
    jquery-rails (1.0.12)
      railties (~> 3.0)
      thor (~> 0.14)
    mail (2.3.0)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.16)
    multi_json (1.0.3)
    polyglot (0.3.1)
    rack (1.3.1)
    rack-cache (1.0.2)
      rack (>= 0.4)
    rack-mount (0.8.1)
      rack (>= 1.0.0)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.0)
      rack (>= 1.0)
    rake (0.9.2)
    rdoc (3.8)
    sass (3.1.4)
    sass-rails (3.1.0.rc.4)
      actionpack (~> 3.1.0.rc1)
      railties (~> 3.1.0.rc1)
      sass (>= 3.1.4)
      sprockets (>= 2.0.0.beta.9)
    sprockets (2.0.0.beta.10)
      hike (~> 1.0)
      rack (~> 1.0)
      tilt (!= 1.3.0, ~> 1.1)
    sqlite3 (1.3.3)
    thor (0.14.6)
    tilt (1.3.2)
    treetop (1.4.9)
      polyglot (>= 0.3.1)
    turn (0.8.2)
      ansi (>= 1.2.2)
    tzinfo (0.3.29)

PLATFORMS
  ruby

DEPENDENCIES
  jquery-rails
  rails!
  sass-rails
  sqlite3
  turn
@Mochaleaf

You'll need to name your stylesheet common.css.sass for things to work correctly.

@tallica

My bad. Thank you. Works as expected :)

@tallica tallica closed this Jul 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment