1

I have a site running on Heroku using Compass with Saas an is working fine (compiling assets when pushing to Heroku seems to be fine).

I added a new folder inside assets to namespace other styling, like this

/app/assets/stylesheets/site/site1.css
/app/assets/stylesheets/site/site2.css
/app/assets/stylesheets/site/common/base.css.saas
/app/assets/stylesheets/site/site/site1.css.saas
/app/assets/stylesheets/site/site/site2.css.saas
...

The problem is when I visit a page that use site1.css styling I get the following error

Error compiling CSS asset
Sass::SyntaxError: File to import not found or unreadable: ../compass/css3/text-shadow.
Load path: /app
  (in /app/app/assets/stylesheets/site/common/base.css.sass)

  /app/app/assets/stylesheets/site/common/base.css.sass)

The line that the error refers is this

/app/assets/stylesheets/site/common/base.css.sass
@import "../compass/css3/text-shadow"

I tried both "../compass/css3/text-shadow" and "compass/css3/text-shadow". In both cases I got the same error.

Any idea how to solve this?

Martin
  • 11,216
  • 23
  • 83
  • 140
  • Are you using a --watch command? If so can you include that in your question? Also are you watching the directory or the individual file? – khollenbeck Oct 22 '12 at 19:45
  • Out of curiosity. Why are you using .css.sass for your extension instead of using .scss? – khollenbeck Oct 22 '12 at 19:50
  • @Kris what is the purpose of watch command and where should be used? – Martin Oct 22 '12 at 19:50
  • I prefer the older syntax without brackets. – Martin Oct 22 '12 at 19:51
  • I am not super familiar with how Heroku's environment is set up. But in order to compile your SASS to CSS their should be a watch command to watch your SASS file. Everytime you update your SASS file it will compile and output as CSS... – khollenbeck Oct 22 '12 at 19:52
  • So what version of SASS are you using then? The older version I am assuming? – khollenbeck Oct 22 '12 at 19:53
  • Here is an example of the SASS watch command... http://sass-lang.com/tutorial.html, my guess is the path in your watch command is incorrect. I am assuming Heroku has a config file or something where that is set up. – khollenbeck Oct 22 '12 at 19:54
  • sass is 3.1 and compass 0.12.2, anyways I uses sass through sass-rails (3.2.5). I'm not familiar with any --watch command. Assets a precompiled automatically when deployed. Not sure what are you referring to. – Martin Oct 22 '12 at 20:08
  • Okay well based off the error it is most likely and issue with your path or something is off with your version of SASS and Compass... Take a look at this post... http://stackoverflow.com/questions/6480124/how-to-use-compass-with-rails-3-1 – khollenbeck Oct 22 '12 at 20:14
  • I don't see how that thread is related to this question. All gems I have installed are the newest version. current sass installed version is 3.2.1. – Martin Oct 22 '12 at 20:26

1 Answers1

1

Solved.

I needed to specify on production.rb file the additional files to compile

config.assets.precompile +=
  Dir["#{Rails.root}/app/assets/stylesheets/site/site/*.*"].collect {|s| "site/" + File.basename(s).gsub(/.scss|.sass/, '') }

Now is working fine.

Martin
  • 11,216
  • 23
  • 83
  • 140