SCSS・Compassのインストールに失敗する場合にするべきたった一つのこと

開発ツール

Compassを試してみたくてインストールしたら色々なサイトで紹介されている方法の1行目でつまずきました
解決方法がわからずにあれこれ試しましたが結局必要なことは1つだけでした

compassのインストール

~~~
sudo gem update –system
sudo gem install compass
~~~

とやったら

~~~
$ sudo gem update –system
Updating RubyGems
ERROR: http://rubygems.org/ does not appear to be a repository
ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)
timed out (http://rubygems.org/yaml)
~~~

こうなった(^_^;)
ググっても原因が全くわからず…

ちなみに
~~~
$ gem –version
1.3.6~~~

たぶんMBAを買ってからgemはそのまんま触ってないんじゃないかと思います

RubyGemsを手動で入れる

Download RubyGems | RubyGems.org | your community gem host

ここに書いてあるようにダウンロードして、そのディレクトリに移動してコマンドを打つだけ

~~~
$ cd ~/Downloads/rubygems-2.0.3/
$ sudo ruby setup.rb

——————————————————————————

RubyGems installed the following executables:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for ruby libraries. You may access it like this:
ri Classname
ri Classname.class_method
ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
–no-document flag, or set it as the default in your ~/.gemrc file. See
‘gem help env’ for details.
~~~

~~~
$ gem –version
2.0.3
~~~

入ったらしいので再チャレンジ

~~~
$ sudo gem update –system

Latest version currently installed. Aborting.
~~~

~~~
$ sudo gem install compass

Fetching: sass-3.2.7.gem (100%)
Successfully installed sass-3.2.7
Fetching: chunky_png-1.2.7.gem (100%)
Successfully installed chunky_png-1.2.7
Fetching: fssm-0.2.10.gem (100%)
Successfully installed fssm-0.2.10
Fetching: compass-0.12.2.gem (100%)
Successfully installed compass-0.12.2
Installing ri documentation for sass-3.2.7
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for chunky_png-1.2.7
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for fssm-0.2.10
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for compass-0.12.2
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for sass, chunky_png, fssm, compass after 31 seconds
4 gems installed
~~~

なんかwarningが出たけど入ったっぽい??

試してみる
~~~
$ compass create demo

*********************************************************************
Congratulations! Your compass project has been created.

You may now add and edit sass stylesheets in the sass subdirectory of your project.

Sass files beginning with an underscore are called partials and won’t be
compiled to CSS, but they can be imported into other sass stylesheets.

You can configure your project by editing the config.rb configuration file.

You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
1. To compile on demand:
compass compile [path/to/project]
2. To monitor your project for changes and automatically recompile:
compass watch [path/to/project]

More Resources:
* Website: http://compass-style.org/
* Sass: http://sass-lang.com
* Community: http://groups.google.com/group/compass-users/

To import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:

~~~

やっとスタートラインに立てたっぽいので色々試してみる

コメント

  1. Macにsass + compassを導入する | a-z0-9::Blog より:

    […] SCSS・Compassのインストールに失敗する場合にするべきたった一つのこと http://nob-log.info/2013/03/15/rubygems-install-manually/ […]

タイトルとURLをコピーしました