0

I am trying to get use of great David Hererra's advice on how to use grunt-contrib-compass with Wordpress parent and child themes. You can find his tutorial here: https://gist.github.com/dlh01/5726683

But to my question: I have 2 projects (parent theme and child theme) with 2 different importPaths. My gruntfile.js for both of them is sitting on the root of my web project. I am receiving following error:

Nothing to compile. If you're trying to start a new project, you have left off the directory argument.

I'm not entirely sure what the error means - there is no "directory argument" in plugin documentation. Although I am sure I must be missing something obvious. :) Here goes the relevant part of my gruntfile.js:

    compass: {
            options: {
                // Directories
                sassDir: 'sass/dev/',
                imagesDir: 'img/public/',
                javascriptsDir: 'js/public/',
                fontsDir: 'font/',
                // Options
                environment: 'development',
                outputStyle: 'expanded',
                //relativeAssets: true
            },
            parent: {
                options: {
                    importPath: 'web/app/themes/wpgrouse-theme-parent/assets/sass-parent/dev/',
                    httpPath: 'web/app/themes/wpgrouse-theme-parent/assets/',
                    cssDir: '/'
                }
            },
            child: {
                options: {
                    importPath: 'web/app/themes/wpgrouse-theme-parent/assets/sass/dev/',
                    httpPath: 'web/app/themes/lifeforce/assets/',
                    cssDir: '/'
                }
            }
    },

I've tried various "voodoo" sollutions, but none of them work. After some jerking around in arguments, I've even received this:

RuntimeError on line 52 of /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb: cannot generate tempfile `/style.css20140702-6925-1cg6d1c-9'

Can you shed a little light on what I am doing wrong? Thank you. Quick response would be very appreciated, as I am way behind my deadline and this is very frustrating. :)

Thanks, P!

Edit

It is also probably good to add, that when I was working with one project, everything went fine, so there must be a problem with the "2 projects configuration" part of my gruntfile.js I've posted here.

Edit 2

If I specify basePath argument under each project (parent and child) pointing to same directory as httpPath argument, I am receiving previously mentioned error about tempfile. Does this help?

Petr Cibulka
  • 2,452
  • 4
  • 28
  • 45

1 Answers1

0

While running 'grunt watch' and trying to force my sass to compile, I was also getting the error:

cannot generate tempfile `./.sass-cache/..."

It turned out to be a problem with my permissions settings on the server. I didn't have permission to write to the .sass-cache folder. All I had to do was run

sudo chmod -R 777 .sass-cache/

and the error went away!