简体   繁体   English

如何以 root 用户身份安装 rbenv、Ruby、gems 和 Rails

[英]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.我以 root 用户身份安装了 rbenv、Ruby、gems 和 Rails,所以我无法以普通用户身份运行 Ruby。

When I try using bundle install , it returns:当我尝试使用bundle install ,它返回:

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.我尝试以普通用户身份运行它,但 rbenv、Ruby、gems 和 Rails 无法正常工作。

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.我正在使用 Ubuntu 14.04,并按照“使用 rbenv 修饰您的应用程序的 Ruby 环境。 ”进行安装。

Uninstall rbenv , you may need to use sudo or to start a shell as root that means run the command sudo su .卸载 rbenv ,您可能需要使用sudo或以root身份启动 shell,这意味着运行命令sudo su Then run exit to go back to normal user.然后运行exit返回到普通用户。

Then install rbenv again as normal user.然后以普通用户身份再次安装rbenv。 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). Ubuntu 14.04 不再受支持,因此如果您可以升级到 16.04,您可以按照本教程进行操作,或者如果您必须按照本教程(作为普通用户)安装 ubuntu 14.04。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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