简体   繁体   中英

Can't install gems on digitalocean

I am trying to deploy a ruby on rails app to digitalocean following their tutorial ( https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04 ).

I keep hitting a wall once I get to "gem install bundler" part. Or any gem for that matter. The error that comes up is

You don't have write permissions for the /usr/share/rvm/gems/ruby-2.7.2 directory.

I am actually using rbenv as a ruby version manager, but I can't delete rvm as I get a "permission denied" error there as well. Could not find any information on this error either here or on digitalocean and would appreciate any help

You can use "sudo" to run any command as root, which will bypass any "permission denied" issues you may face. For example, if you try to remove a file using "rm FILENAME" and you get a permission denied, try "sudo rm FILENAME". It will ask you for your root password. After you enter it, the machine will do the operation regardless of if it is a good idea or not.

Completely uninstall rvm before starting the install using rbenv. You might also want to remove any environment variables or PATH references to rvm. Having two different version managers will cause you a lot of problems down the line, so it is worth it to be thorough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM