5

Okay, so I have had this issue before where the @import in my css.scss files required the extension:

@import 'layout.css.scss'

instead of

@import 'layout'

Not sure why this only happens in production (locally I have no problems). I hate having to add the extension, not sure why, I guess it just annoys me that I have to type it out? :)

My problem I'm having though is that I cannot seem to get compass to work in production. I'm using the compass-rails gem. I have a _config.css.scss file which has the following imports at the top:

@import "compass";
@import "compass/css3";

I tried adding css.scss to them and then the files are not found (even locally). So my questions are this:

Is there ANY WAY I can use @import without having to include the file extension(s)?

If not, how do I get Compass to work?

Again this is only affecting me in production.

I've tried a few different things I've found on Stackoverflow already but nothing has helped.

Sass import error in Rails 3 app - "File to import not found or unreadable: compass"

The exact error I get when I run the app on production:

Completed 500 Internal Server Error in 920ms
ActionView::Template::Error (File to import not found or unreadable: compass.

UPDATE

I did successfully add .scss to my compass import

@import 'compass.scss'

This no longer threw the 'file not found' error LOCALLY.

But in production I am still getting this error:

ActionView::Template::Error (File to import not found or unreadable: compass.scss

So this tells me that maybe my Compass gem is not working correctly in production?

Community
  • 1
  • 1
jarodtaylor
  • 471
  • 4
  • 11
  • Which version of the compass gem? Which version of Rails? Which config options do you have set related to the asset pipeline in `config/environments/production.rb`? If you are set NOT to compile assets in production then have you precompiled them before deploy? – jefflunt Apr 12 '13 at 19:42
  • 1
    Are you precompiling your assets? – fotanus Apr 12 '13 at 22:22
  • @normalocity I'm using version compass 0.12.2 and compass-rails 1.0.3 @fotanus I am also Heroku does this for me. I have `config.assets.initialize_on_precompile = true` also because RefineryCMS requires this. @lolmaus I am using RVM, yes. – aarona Apr 15 '13 at 22:50

1 Answers1

8

Delete your Gemfile.lock and just put gem 'compass' and gem 'compass-rails' in Gemfile. After this try bundle install for production env.

shrikant1712
  • 4,336
  • 1
  • 24
  • 42
  • 3
    Thanks. Removing my Gemfile.lock file and then recreating it with `bundle install` worked for me. – aarona Apr 15 '13 at 23:35