wdews
wdews

Reputation: 352

Gulp Compiling Issues with gulp-ruby-sass

I am having two issues in compiling Sass using Gulp currently. Firstly, I set 777 permissions in my "/Library/Ruby/Gems" directory to free up some permissions errors I was getting. I'm now receiving a warning each time I run Gulp, stating the following:

gulp-ruby-sass: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:213: warning: Insecure world writable dir /Library/Ruby/Gems/2.0.0 in PATH, mode 040777

Second, things seem to halt in terms of Sass compilation when Gulp runs into some of the "@import" declarations in my primary SCSS file. Namely, I get the following errors:

gulp-ruby-sass: error ./screen.scss (Line 4: File to import not found or unreadable: normalize.
Load paths:
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/compass-breakpoint/stylesheets
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/susy/sass
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/normalize-scss
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass)

These load paths look incorrect...I've installed these components via Bower for this project specifically, so it almost seems like I need to tell Gulp/NPM to look in my project folder instead.

Any help would be greatly appreciated!

Upvotes: 2

Views: 1509

Answers (1)

wdews
wdews

Reputation: 352

Looks like this question was just me doing a whole lot of talking to myself, but I'll share my findings with the world nonetheless.

Turns out, this is a known issue with the gulp-ruby-sass package. See: https://github.com/sindresorhus/gulp-ruby-sass/pull/80#issuecomment-49531932

Paths specified in the "loadPath" option in my gulpfile were not relative to the gulpfile's location in the project I was working with, so it wound up looking for some Bower components in a folder where it shouldn't have, for example:

/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/compass-breakpoint/stylesheets

I found that, by prepending process.cwd() to each of my file paths, they would become relative.

If you take a look at the GitHub link I added a few lines above, you'll notice this is simply a temporary workaround until this fix is implemented into the master branch of gulp-ruby-sass, so this advice will become irrelevant at some point in the near future.

Hope this helps anybody that was in a similar, puzzled situation.

* EDIT *

As for the permissions warning I was getting for gulp-ruby-sass, it turned out I just needed to run sudo chmod -R 775 /Library/Ruby/Gems/2.0.0 to recursively change the permissions in the Gems directory.

Upvotes: 5

Related Questions