gem, npmのメモ
Rubyのパッケージ管理システムRubyGemsのコマンド。
RubyGemsは、Ruby言語用のパッケージ管理システムであり、Rubyのプログラムと(”gem” と呼ばれる)ライブラリの配布用標準フォーマットを提供している。gemを容易に管理でき、gemを配布するサーバの機能も持つ。Rubyバージョン1.9以降では標準ライブラリの一部となっている。
Macにはgemがインストール済みだったので以下インストール済みとする。
$ which gem
gemは/usr/bin/gem
$ gem -v
$ gem --help または $ gem -h
$ gem bar -h # gem barのヘルプ
$ gem list -h # 例 gem listのヘルプ
$ gem list --local # ローカルのパッケージ表示
$ gem list --both # ローカル、リモートの両方とも表示。
$ gem -v # バージョン表示
$ sudo gem update --system # gem自体のバージョンアップ
$ sudo gem update foo # gemでインストールしたパッケージfooのバージョンアップ
例としてsass, compassのバージョンアップ
$ sudo gem update sass
$ sudo gem update compass
Node.jsのパッケージ管理シスム。
$ which npm
/usr/local/bin/npm
$npm install パッケージ名
$npm install -g パッケージ名
-gをつけてインストールするときはsudoで実行する。
$ npm -h # クイックヘルプ --helpはない
$ npm -l # display full usage info
$ npm list
$ npm list -g
$ npm update パッケージ名
$ sudo npm update -g パッケージ名
Mac OS X向けパッケージ管理システム。
» Homebrew — MacPorts driving you to drink? Try Homebrew!
$ brew doctor
上記コマンドで表示されたエラー
Warning: Some directories in your path end in a slash.
Directories in your path should not end in a slash. This can break other
doctor checks. The following directories should be edited:
bashを使っているのでホームディレクトリの.bash_profileを修正
No comments yet.
改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。