Mac OS X el captionでgem installする際にpermissionエラーが発生する場合の対処方法


本日github pagesとjekyllを使ってサイトを作ろうと思った際にインストールエラーが発生したの自分用にメモ

参考
jekyll + GitHub Pagesを使って無料でブログサイトを作る

IT/WEB業界への転職なら求人サイトGreen

gem installを使った際にエラーが発生したので対処方法をメモ

$ gem install jekyll

Fetching: liquid-3.0.6.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

対処法

インストール先を/usr/local/binに変更する事でエラーを回避できました。

$ sudo gem install -n /usr/local/bin jekyll
Password:
Fetching: liquid-3.0.6.gem (100%)
Successfully installed liquid-3.0.6
Fetching: kramdown-1.9.0.gem (100%)
Successfully installed kramdown-1.9.0
Fetching: mercenary-0.3.5.gem (100%)
Successfully installed mercenary-0.3.5
Fetching: safe_yaml-1.0.4.gem (100%)
Successfully installed safe_yaml-1.0.4
Fetching: colorator-0.1.gem (100%)
Successfully installed colorator-0.1
Fetching: rouge-1.10.1.gem (100%)
Successfully installed rouge-1.10.1
Fetching: sass-3.4.20.gem (100%)
Successfully installed sass-3.4.20
Fetching: jekyll-sass-converter-1.4.0.gem (100%)
Successfully installed jekyll-sass-converter-1.4.0
Fetching: rb-fsevent-0.9.7.gem (100%)
Successfully installed rb-fsevent-0.9.7
Fetching: ffi-1.9.10.gem (100%)
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: listen-3.0.5.gem (100%)
Successfully installed listen-3.0.5
Fetching: jekyll-watch-1.3.0.gem (100%)
Successfully installed jekyll-watch-1.3.0
Fetching: jekyll-3.0.1.gem (100%)
Successfully installed jekyll-3.0.1
Parsing documentation for liquid-3.0.6
Installing ri documentation for liquid-3.0.6
Parsing documentation for kramdown-1.9.0
Installing ri documentation for kramdown-1.9.0
Parsing documentation for mercenary-0.3.5
Installing ri documentation for mercenary-0.3.5
Parsing documentation for safe_yaml-1.0.4
Installing ri documentation for safe_yaml-1.0.4
Parsing documentation for colorator-0.1
Installing ri documentation for colorator-0.1
Parsing documentation for rouge-1.10.1
Installing ri documentation for rouge-1.10.1
Parsing documentation for sass-3.4.20
Installing ri documentation for sass-3.4.20
Parsing documentation for jekyll-sass-converter-1.4.0
Installing ri documentation for jekyll-sass-converter-1.4.0
Parsing documentation for rb-fsevent-0.9.7
Installing ri documentation for rb-fsevent-0.9.7
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 listen-3.0.5
Installing ri documentation for listen-3.0.5
Parsing documentation for jekyll-watch-1.3.0
Installing ri documentation for jekyll-watch-1.3.0
Parsing documentation for jekyll-3.0.1
Installing ri documentation for jekyll-3.0.1
14 gems installed

これでjekyllを使えるようになりました。

gem install bundlerする際にもこの方法で出来ました。

sudo gem install -n /usr/local/bin bundler

以下のサイトを参考にさせていただきました。

El Capitanにしたらmailcatcherがなくなっていたので入れなおす

 

この記事が気に入ったら
いいね!しよう

最新情報をお届けします

follow us in feedly