急いでイソイテク

並盛り技術ダクダクで。

compassを使うまでのRubyの設定 + compass使用方法(メモ)

Rubyのインストール

RubyInstallerをダウンロードする

http://rubyinstaller.org/downloads/
にアクセスし、最新「Ruby 2.2.3 (x64)」(※2015/11/12時点)をクリック。

DevKitをダウンロードする

同じくhttp://rubyinstaller.org/downloads/
にアクセスし、「For use with Ruby 2.0 and above (x64 - 64bits only)」の方を選んでインストーラをダウンロードする。

DevKitのインストール

DOSプロンプトを開き、DevKitの展開先フォルダに移動する。
ruby dk.rb initを実行し、下記が出るのを確認する。

[INFO] found RubyInstaller v2.2.3 at C:/Ruby/Ruby22

Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

次にruby dk.rb installを実行し、下記が出るのを確認する。

[INFO] Installing 'C:/Ruby/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/defaults/operating_system.rb'
[INFO] Installing 'C:/Ruby/Ruby22/lib/ruby/site_ruby/devkit.rb'

Compassインストール

下記をそれぞれ実行。

gem update --system

sudo gem install compass

こんなメッセージが出た。

C:\Users\isomu_000\Downloads>gem install compass
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.10
Fetching: rb-inotify-0.9.5.gem (100%)
Successfully installed rb-inotify-0.9.5
Fetching: compass-1.0.3.gem (100%)
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed compass-1.0.3
Parsing documentation for ffi-1.9.10
Installing ri documentation for ffi-1.9.10
Parsing documentation for rb-inotify-0.9.5
Installing ri documentation for rb-inotify-0.9.5
Parsing documentation for compass-1.0.3
Installing ri documentation for compass-1.0.3
Done installing documentation for ffi, rb-inotify, compass after 22 seconds
3 gems installed

参考

liginc.co.jp

sass --> css 自動コンパイル

  1. config.rbがおいてあるパスを調べる
    例:「/home/aaa/sasspj/ex1」だとする
  2. 下記を実行し、監視させる(終わるときはCtrl+Cらしい)
    compass watch /home/aaa/sasspj/ex1