简体   繁体   中英

How to install rbenv, Ruby, gems and Rails as root user

I installed rbenv, Ruby, gems and Rails as the root user, so I cannot run Ruby as a normal user.

When I try using bundle install , it returns:

Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.

I tried to run it as a normal user, but rbenv, Ruby, gems and Rails are not working.

How can I make them available to normal users?

I am using Ubuntu 14.04, and followed " Groom your app's Ruby environment with rbenv. " to install.

Uninstall rbenv , you may need to use sudo or to start a shell as root that means run the command sudo su . Then run exit to go back to normal user.

Then install rbenv again as normal user. Ubuntu 14.04 is no longer supported so if you can upgrade to 16.04 you may follow this tutorial or if you have to use ubuntu 14.04 install following this tutorial (as normal user).

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