I am on 3.2.1, with sass-rails-3.2.4 and sass-3.1.15...
The documentation for the asset pipeline says:
asset-url(\"rails.png\", image) becomes url(/a
We just had the same problem and fixed it by explicitly requiring sprockets in the Gemfile (even though it's a dependency of ActionPack):
group :assets do
gem 'sprockets'
gem 'sass-rails', '~> 3.2.3'
# ...
end
I don't know why, but it works now. ;-)
You might want to try clearing /tmp/cache. I am too new to Rails and Sass to know why this worked, but it solved the same problem for me after hours of searching.
BTW, this worked despite the fact that I could see other Sass directives, such as setting variables and calculating with them, being executed. I'm sure there is a very simple explanation, once I have time to track it down.
You can just add a trailing forward slash /
to the path and use url
like you usually do.
background-image: url("/assets/rails.png")