11
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Mac]Rails コマンドでエラー /usr/local/bin/rbenv-communal-gem-home Permission denied

Posted at

起こったこと

Gemfile にgem 追加して、bundle install でインストールしてたら、
Rails コマンドでエラー(Permission denied) がでる

$ rails
/usr/local/bin/rbenv-communal-gem-home: line 21: /usr/local/bin/../version_cache/2.6.3: Permission denied
$ rails
Failed loading /usr/local/Cellar/php/7.3.3/pecl/20180731/xdebug.so:  dlopen(/usr/local/Cellar/php/7.3.3/pecl/20180731/xdebug.so, 9): image not found
PHP Warning:  PHP Startup: Unable to load dynamic library 'imap' (tried: /usr/local/lib/php/pecl/20180731/imap (dlopen(/usr/local/lib/php/pecl/20180731/imap, 9): image not found), /usr/local/lib/php/pecl/20180731/imap.so (dlopen(/usr/local/lib/php/pecl/20180731/imap.so, 9): image not found)) in Unknown on line 0
usage: dirname path
mkdir: /../version_cache: Permission denied
/usr/local/bin/rbenv-communal-gem-home: line 22: /../version_cache/2.6.3: No such file or directory

解決策

/usr/local/bin/rbenv-communal-gem-home 内部の キャッシュのPath が違うらしいので変更。 (例)

/usr/local/bin/rbenv-communal-gem-home
 14 +  cachedir="$RBENV_ROOT/.communal-gem-version-cache"
 15   # cachedir="${BASH_SOURCE%/*}/../version_cache"

参考

11
10
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
11
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?