Configuring Compass on Windows

本秂侑毒 提交于 2019-12-03 21:10:27

here's how I do it

(One time)

  1. install ruby http://rubyinstaller.org/

  2. install compass, in a command window enter

    gem install compass
    
  3. to add compass to an MVC project, navigate to project folder and in a command window enter

    compass create
    

    you will get the default config.rb ... but here is my usual one

    http_path = "/"
    css_dir = "content/css"
    sass_dir = "content/sass"
    images_dir = "images"
    javascripts_dir = "scripts"
    
  4. to install bootstrap (for more info see https://github.com/thomas-mcdonald/bootstrap-sass) add

    require 'bootstrap-sass'
    

    to your config.rb

    enter (in your command window)

    gem install bootstrap-sass
    

    (I had to do a (in your command window) gem update after this but you may not need to)

    enter (in your command window)

    compass install bootstrap
    

(then ... every time you open the solution in Visual Studio)

  1. navigate to project folder
  2. in a command window enter

    compass watch
    

    (this will monitor project for saves and re-compile the scss files)

Hope that helps

Cheers Stu

To install Compass, you should open your Windows console with Win+R, cmd and run:

gem update --system
gem update
gem install compass

Don't forget to remove all the stuff that you littered you Ruby installation with.

Use this command in order to add GEM to the Windows Path environment variables:

set PATH=C:\Ruby200-x64\bin;%PATH%

In the Ruby command you should write:

gem update --system

(this block of code updates all the gems in the Ruby)

Then you install sass like it:

gem install sass

(You said that you already has sass, so you don't need to write this code again.)

Then, you write this line:

gem install compass

(Now, you will have compass in your machine)

To know the version that was installed, you can write:

compass --version

To create a new project in your desktop machine, you can write this line of code:

compass create desktop/my-project

(This will create a compass folder in the desktop of your machine called my-project. I hope this is helpful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!