Blame docs/setup-environment.md

Packit bfcc33
## Requirements
Packit bfcc33
In order to install and setup your local development environment, there are some prerequisites:
Packit bfcc33
Packit bfcc33
* git
Packit bfcc33
* gcc/clang/llvm (Linux: build tools, Mac OS X: XCode w/ Command Line Tools)
Packit bfcc33
* ruby w/ bundler
Packit bfcc33
Packit bfcc33
OS X:
Packit bfcc33
First you'll need to install XCode which you can now get from the AppStore installed on your mac. After you download that and run it, then run this on the command line:
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
xcode-select --install
Packit bfcc33
````
Packit bfcc33
Packit bfcc33
## Cloning the Projects
Packit bfcc33
Packit bfcc33
First, clone the project and then add a line to your `~/.bash_profile` that will let other programs know where the LibSass dev files are.
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
git clone git@github.com:sass/libsass.git
Packit bfcc33
cd libsass
Packit bfcc33
echo "export SASS_LIBSASS_PATH=$(pwd)" >> ~/.bash_profile
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
Packit bfcc33
Then, if you run the "bootstrap" script, it should clone all the other required projects.
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
./script/bootstrap
Packit bfcc33
````
Packit bfcc33
Packit bfcc33
You should now have a `sass-spec` and `sassc` folder within the libsass folder. Both of these are clones of their respective git projects. If you want to do a pull request, remember to work in those folders. For instance, if you want to add a test (see other documentation for how to do that), make sure to commit it to your *fork* of the sass-spec github project. Also, whenever you are running tests, make sure to `pull` from the origin! We want to make sure we are testing against the newest libsass, sassc, and sass-spec!
Packit bfcc33
Packit bfcc33
Now, try and see if you can build the project. We do that with the `make` command.
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
make
Packit bfcc33
````
Packit bfcc33
Packit bfcc33
At this point, if you get an error, something is most likely wrong with your compiler installation. Yikes. It's hard to cover how to fix this in an article. Feel free to open an issue and we'll try and help! But, remember, before you do that, googling the error message is your friend! Many problems are solved quickly that way.
Packit bfcc33
Packit bfcc33
## Running The Spec Against LibSass
Packit bfcc33
Packit bfcc33
Then, to run the spec against LibSass, just run:
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
./script/spec
Packit bfcc33
````
Packit bfcc33
Packit bfcc33
If you get an error about `SASS_LIBSASS_PATH`, you may still need to set a variable pointing to the libsass folder, like this:
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
export SASS_LIBSASS_PATH=/Users/you/path/libsass
Packit bfcc33
````
Packit bfcc33
Packit bfcc33
...where the latter part is to the `libsass` directory you've cloned. You can get this path by typing `pwd` in the Terminal
Packit bfcc33
Packit bfcc33
## Running the Spec Against Ruby Sass
Packit bfcc33
Packit bfcc33
Go into the sass-spec folder that should have been cloned earlier with the "bootstrap" command. Run the following.
Packit bfcc33
Packit bfcc33
````
Packit bfcc33
bundle install
Packit bfcc33
./sass-spec.rb
Packit bfcc33
````
Packit bfcc33
Packit bfcc33
Voila! Now you are testing against Sass too!
Packit bfcc33