rails/rails — Issue #4723: Sass::SyntaxError - Undefined variable when upgrading to rails 3.2
Author: cdamian
Created: 2012-01-27 14:53:02+00:00
State: open

After upgrading to rails 3.2, I'm getting this issue with the asset pipeline. Variables defined in one partial are not being recognized in the following ones. There are no problems with rails 3.1.3. /cc @spastorino

**Sass::SyntaxError**
Undefined variable: "$blue".

Here is how I'm using it.

```ruby
# app/assets/stylesheets/application.css.scss
/*
*= require reset
*= require_self
*/

@import "layout.css.scss";
@import "forms.css.scss";
```

```ruby
# app/assets/stylesheets/layout.css.scss

$blue: #17507c;
```

```ruby
# app/assets/stylesheets/forms.css.scss

form {
h2 {
color:$blue;
}
}
```

```ruby
# Gemfile

gem 'rails', '3.2.1'

group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 1.2.2'
end
```