Installing Sass on PC with no command line knowledge - css

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

Related

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

LESS css compiler help in terminal

Im using Ubuntu 13.04 (Linux)
I have installed node, and npm. With npm I downloaded less via terminal.
Im using this on my simple HTML/CSS project. pure frontend. its not a Ruby or nodejs project.
And when I do
lessc styles.less styles.css -x -w
in terminal, it compiles and compresses the code, but doesn't watch the file for changes, since Im expecting LESS to auto compile and refresh the page automatically. So, if I do any changes in my styles.less, every-time I have to go to terminal and enter the command to compile the less css.
Also, the compiler does NOT even show any compile errors even if I add anything on purpose, but in that case it doesn't compiles.
Please guide me on how to achieve the above. This is my first day with LESS CSS.
If you type lessc help you will see that there is no argument -w or --watch. What you can do is to use a build system like GruntJS with an extension like grunt-contrib-watch and have that monitor your less files and build the css on change.
I did this with help of #Oil on ubuntu forums.
In terminal,
1. install sudo apt-get install inotify-tools
then simply CD to the css folder.
and run below lines together:
while inotifywait -r styles.less; do
lessc -x styles.less styles.css;
done

Installing Sass on Gentoo

I've been trying to install Sass on Gentoo, but it hasn't been going too well. Unfortunately, the latest version of Sass in portage is 3.1.21.
What I want to use Sass for requires at least Sass 3.2, which is available through rubygems.
What I've tried:
emerge dev-ruby/sass (installs an old version)
gem install sass
The second command appears to install the Sass gem. However, I do not use Rails or Ruby in any other aspect apart from Sass, so the gem appears useless to me. In addition, I do not know where gems are installed to or how to use them (I'm a ruby noob.) All I want to do is call sass from the command line.
Are there any ways to obtain an up-to-date version of Sass which I can just use from the command line?
Cheers.
On Gentoo, user-installed gems are not in your PATH by default. I have created a bug report because while user-installed gems work much better than they used to, this problem really needs to be rectified. You can help by voicing your opinion in the report and linking back to this page. To get things working, you can either deploy the script I uploaded to the report or use RVM instead, which will give you much more consistent behaviour across distros.
I'm wondering but all the answers looks weird for me. One of the biggest gentoo advantage is ebuild writing which is easy as pie so every user can contribute whatever he needs.
Add local overlay
fork upstream ebuild to your local overlay
bump version
use
test
attach tested ebuild to bug report, maybe also contact someone on #gentoo-dev-help
Trust me, using gem (or cabal, or whatever) instead of your package manager if way to mess your system.
Some might find useful to know that under Gentoo you can install sass using emerge which will solve the PATH problem some people are encountering.
# emerge -av sass
after which you should be able to use sass without problem.
Another solution would be to use rvm which could make things more portable and uniform across environments.
edit: in case someone's asking: to install rvm just follow the instructions found at: https://rvm.io/rvm/install/ and install the stable version.
I don't see a down side to using the gem version of Sass. I'm also not a Ruby/RoR developer (I use Haskell/PHP), and I just use the gem. I know just enough about gems to install/uninstall them, and that seems good enough for using Sass.
Installing and upgrading Sass is done with the same command:
sudo gem install sass
Installing Sass via gems gives you the ability to use it via command line, just like it shows on the official website: http://sass-lang.com/.
sass --watch style.scss:style.css
Other command line options can be found via --help or on their docs: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#using_sass
sass --help
Consider using compass it will accepts command lines like: compass [YOUR-FILE].sass and can also compass watch [SASS FOLDER] and 'compile' css to it.
http://compass-style.org/
To install using a gem
gem update --system
gem install compass
Installation

How to know the path of Compass executable?

I am trying to use compass with Drupal 7, Basic theme and Compass module on my local hosting on Windows. It is already installed on my computer. Should i install it to my local webserver again, how can i know the path of existing Compass exutable?
Some more details would help get to the root of the problem:
Are you running compass from the command line, or using a GUI utility?
Did you install compass via gem install compass ?
What version of Windows are you running?
If you have properly installed ruby and compass, you should be able to cd into your drupal theme's directory and run compass watch to compile.
You can use the where command from the windows command prompt (where compass or, if that doesn't work where ruby) which will search your current directory and $PATH. If you cannot find compass, then you may need to reinstall compass/ruby.
Hope that helps!

How can I run the emberjs tests on a webserver like nginx/apache?

I cloned the git repo and placed in the document root of my nginx install. But when I run http://localhost/ember.js/tests/index.html?package=ember-runtime, get the following error:
Uncaught The module 'handlebars' could not be found, http://localhost/ember.js/tests/minispade.js:39
Source:
at Object.<anonymous> (http://localhost/ember.js/tests/qunit/qunit.js:832:4)
Is there anyway to run the tests without having the whole ruby infrastructure installed?
Handlebars isn't Ruby, it is a javascript library. I'm not sure why you think that you need Ruby from the output you've posted here.
...
Looking at the docs, it looks like the tests need the rake-pipeline gem. So yes, you'll need Ruby installed. I'd recommend using RVM if you are on a Mac or Linux.

Resources