3

Last night I think I did something that hosed my rails development environment, and I'm unable to reverse what I did.

I migrated an update to production and was having some trouble precompiling a stylesheet so I backed out the changes and decided to attempt a precompile on my development machine.

Long story short, the precompile failed on my development machine (local) but when I tried to bring up my test system I got this error:

Sprockets::CircularDependencyError in Devise/sessions#new

/app/assets/stylesheets/application.css has already been required

I'm certain this has something to do with my attempted precompile, even though it failed because prior to that everything was working fine.

I tried to do precompile:clear because I read somewhere that will reverse/delete the precompile.

Am I missing something here? Does a precompile change configuration files somewhere that I need to manually reset?

This is rails 3.1 running on Ubuntu 11.10.

lulalala
  • 17,572
  • 15
  • 110
  • 169
user1214966
  • 273
  • 1
  • 4
  • 10

2 Answers2

6

This is happening because your application.css.scss is most likely requiring a css file that's requiring application.css.scss. You'll want to go through app/assets/stylesheets and check the headers of application.css.scss, and then the headers of all the files it requires to make sure that none of them reference application.css.scss.

Veraticus
  • 15,944
  • 3
  • 41
  • 45
  • Thank you! Yes that's precisely what it was. – user1214966 Mar 28 '12 at 14:50
  • 1
    Thanks. I had an `app/assets/stylesheets/application.css.orig` in the directory tree. That was causing my problem. – JellicleCat Sep 17 '13 at 15:44
  • Ultraedit (my text editor) was creating .bak backup files automatically in the the stylesheets folder which caused the same error. Deleting them (and turning off that feature!) resolved the matter. – MSC Mar 28 '15 at 02:41
0

I fixed it by creating an application.css.scss and by importing each of my files in there, like this:

@import "backend.css.scss"; @import "frontend.css.scss";

then it worked

akmur
  • 1,465
  • 2
  • 24
  • 37