Demoted SASS version; Now there's Ruby error - css

My SASS was working really slow, some people online suggested to demote to Sass 3.1.0 (Brainy Betty) because it works faster.
I uninstalled and installed this version.
When I uninstalled it asked whether or not to delete SASS executables, I hit yes.
Now when I use the --watch command, this is the message I get:
Sass is watching for changes. Press Ctrl-C to stop.
NoMethodError: undefined method `empty?' for nil:NilClass
Use --trace for backtrace.
My SASS is no longer working and I am not familiar with Ruby. Thanks

Related

Grunt build fails in travis - "Cannot find any-promise implementation"

I'm using travis to test my code. Recently the grunt tasks have started to fail without no change being made to anything involved with grunt. (The new commit which is tested contains just very minor changes in two PHP files.)
Here is the part of log from travis:
$ grunt build:app
Running "typings:default" (typings) task
Warning: Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register")("bluebird") on application load prior to any require("any-promise"). Use --force to continue.
Aborted due to warnings.
The command "grunt build:app" exited with 3.
I tried to search for that warning message but couldn't find anything useful.
One more thing: When I run grunt build:app locally on my pc it works just fine.
Thanks for your time :)
I had the same problem when I started using grunt-typings. Worked locally and didn't work on my CI server. Ended up fixing it by doing what the error message suggests:
npm install bluebird
npm install any-promise
In GruntFile.js:
require("any-promise/register")("bluebird");
Update your node.js version to >v0.12. To check your version of node.js use node -v. The documentation of any-promise explains:
Node.js versions prior to v0.12 may have contained buggy versions of the global Promise. For this reason, the global Promise is not loaded automatically for these old versions. If using any-promise in Node.js versions versions <= v0.12, the user should register a desired implementation.

Find/reduce scss errors in media query mixin

We've been working with Neat framework for 6 months and love it.
However suddenly we have a critical problem with one of their excellent mixins which we are entirely dependant on for media queries.
Here's a link to the file.
https://github.com/thoughtbot/neat/blob/master/app/assets/stylesheets/grid/_media.scss
Heres the docs for the mixin.
http://thoughtbot.github.io/neat-docs/latest/#media
We've called it in our sass files almost 300 times so its pretty essential, although we mostly only use the first parameters e.g. media( max-width $small-screen)
Although we have also used it in some of the Refills navigation modules which use it in a more advanced way
http://refills.bourbon.io/
Don't know what the error is because gulp-sass and browser-sync crash without sending error messages to the console like it normally does with the way we have it set up.They only crash when this mixin is loaded. Don't know what causes the error
If I start removing the mixin we get error reporting back and gulp-sass doesn't crash any more. ALthough we get errors from all the files that call the mixin.
I've also tried the following
Completely deleting the node_modules directory and doing a fresh npm install
Doing a npm uninstall of gulp and gulp-sass, then a fresh npm install
Doing a global install of node-sass, and doing a global uninstall of node-sass.
Doing a npm rebuild node-sass from within the node_modules/gulp-sass directory
Does anyone have any suggestions/ ideas / solutions ?

SASS error: can't import Compass

I've been using sass and compass on this computer for a few months with no issues.
Additionally, my config.rb and sass directories have always been set up the same way, and they're the same on all of my projects.
Recently, I started getting this error in Sublime when I build the sass: Sass::SyntaxError: File to import not found or unreadable: compass.
The first line of my .scss file is #import "compass";, so I see this error in Terminal: error sass/style.scss (Line 36 of _vertical_rhythm.scss: Incompatible units: 'px' and 'em'.)
I've been searching for days, and I see answers around some of this stuff (the vertical-rhythm specifically), but nothing is my exact problem, and I can't find a solution.
My compass version is 0.12.5 (Alnilam), and my sass version is 3.3.4 (Maptastic Maple).
At work, everything compiles fine with the exact same files, working from the exact same GitHub repo. I need to check my versions of compass and sass at work tomorrow, but in the meantime, I'm stumped.
Any ideas? Has this happened to anyone?
After a month of troubleshooting, the solution ended up being simpler than expected.
I uninstalled all versions of both Sass and Compass, and then I installed the latest Compass and let it install Sass automatically.
So after doing sudo gem uninstall compass and sudo gem uninstall sass, I did sudo gem install compass. That installed both Compass and its dependencies (Sass version 3.2.19). (I'm on a Mac, so I had to use sudo.)
Solved!
if this is on mac:
Go to:
/var/folders/p_/w19t0k956zz_bg0bgs0cn6200000gn/T/liferay
and delete following folders:
document_preview document_thumbnail ruby

Grunt Compass/SCSS not compiling

I'm pretty new to whole Grunt and SCSS workflow stuff and recently configured Grunt with a WP theme development that run under MAMP. Installation of Node, NPM, Grunt and its dependencies went smooth. However, when i make a change on .SCSS files, it doesn't seem to be reflecting the changes to the .CSS files due to following warning from compass:
Running "compass:app" (compass) task
LoadError on line ["55"] of /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- susy
Run with --trace to see the full backtrace
Warning: ↑ Use --force to continue.
Aborted due to warnings.
Not exactly sure what's up but obviously a communication issue between Ruby and Compass?
Whether it be incorrect version mapping or paths..?
I researched and attempted following:
Uninstalled the current and installed new Ruby
Installed RVM (didn't use it, just installed it)
Upgraded compass to the latest version 0.12.2 and made sure this version is reflected in package.json for grunt.
Any pointers and advise highly appreciated!
I don't know if this is an option but you might look at PrePros (https://github.com/sbspk/Prepros). I tried for a while to setup the raw/core setup you are working with but it was just always quirky - not to mention super tedious to setup. PrePros takes all the pain away! Just a suggestion.
Related/Reference link: https://stackoverflow.com/questions/19866550/sass-haml-compile-on-prepros

Installing Sass on PC with no command line knowledge

I'm going through the Sass tutorial and am stuck at this part:
Once you have Ruby installed, you can install Sass by running
gem install sass
So I opened up command prompt and typed in
gem install sass
Just like it said. It doesn't work though. I get this message back:
'gem' is not recognized as an internal or external command, operable program or batch file.
I have almost no knowledge of command line but wish to use Sass. Can someone please walk me through what I'm doing wrong?
Yes I did searches for tutorials for people who don't know command line. I only came up with a Mac guide, which does me no good since I'm on Windows 8, and a program that my company has blocked access to.
This just means the gem executable is not in your %path%. You can either run the ruby installer again and select the check box during the install for "Include ruby in path" (or some similar message) or just add the path (something like C:\Ruby200) to your system %path% variable.
Use Ruby Installer for Windows to install Ruby. After that you'll be able to do gem install sass.
Also, i recommend you get familiar with Compass as soon as possible. Compass is a very ambiguous thing for newcomers, so here's an explaination for you: Import common modules by default when compiling SCSS
And here's a great source of information for SASS newbies: https://github.com/Snugug/training-glossary/wiki

Resources