rails / rails-dev-box

A virtual machine for Ruby on Rails core development
MIT License
2.05k stars 580 forks source link

Permission problem with gem #168

Closed RohitRathore1 closed 4 years ago

RohitRathore1 commented 4 years ago
 gem install bundler
Fetching: bundler-2.0.2.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.5.0 directory.
RohitRathore1 commented 4 years ago

Hello, I am having a problem installing Gem inside a oracle vm.

teampoison@teampoison-VirtualBox:~$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
teampoison@teampoison-VirtualBox:~$ echo "gem: --no-document" > ~/.gemrc
teampoison@teampoison-VirtualBox:~$  gem install bundler
Fetching: bundler-2.0.2.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.5.0 directory.
RohitRathore1 commented 4 years ago

Solved

we have to install gem bundle through sudo if you are using Ubuntu

$ sudo install gem bundler