LoginSignup
30
22

More than 5 years have passed since last update.

RubyのGem::FilePermissionErrorを解決する

Posted at

Macでgemをインストールしようとするとなにやらパーミッションエラー。

$ gem install bundler

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

sudoでパーミッションを与えてやる。

$ sudo gem install bundler

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.

また別の場所でパーミッションエラーが出たので、次は保存場所もlocalにしてやる。

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

Done installing documentation for bundler after 5 seconds
1 gem installed

できた。

$ bundle init

Writing new Gemfile to ~
30
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
22