Rbenv: Can't install bundler

Created on 30 Jan 2018  ·  4Comments  ·  Source: rbenv/rbenv

> gem install bundler
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.3.0 directory.
> cat ~/.bashrc | tail -2
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
> which ruby
/home/gd/.rbenv/shims/ruby

I did rbenv install 2.4.3. I got no errors and I see that's it's there:

> cd ~/.rbenv/versions/
> ls -1
2.4.3

But I can't seem to access it:

> ruby -v
ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
> which gem
/home/gd/.rbenv/shims/gem
> curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
Checking for `rbenv' in PATH: /home/gd/.rbenv/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /home/gd/.rbenv/plugins/ruby-build/bin/rbenv-install (ruby-build 20171226-3-g01e7b7b)
Counting installed Ruby versions: 1 versions
Checking RubyGems settings: OK
Auditing installed plugins: OK

I guess this is the problem:

> gem env home
/var/lib/gems/2.3.0

But I'm not sure how to fix it.

> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.3 (stretch)
Release:    9.3
Codename:   stretch

Any other info I can provide?

Most helpful comment

@gdonald Did you invoke rbenv shell 2.4.3 or rbenv global 2.4.3 ?

All 4 comments

try to use with sudo

@gdonald Did you invoke rbenv shell 2.4.3 or rbenv global 2.4.3 ?

Oh yes I forgot. To work with gems, you must invoke rbenv shell 2.4.3 or rbenv global 2.4.3 :sweat_smile:

Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HuckyDucky picture HuckyDucky  ·  4Comments

slayer picture slayer  ·  4Comments

wakproductions picture wakproductions  ·  4Comments

ghost picture ghost  ·  5Comments

dazza-codes picture dazza-codes  ·  4Comments