0

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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
SudeepShakya
  • 571
  • 3
  • 14
  • 34
  • Did you uninstall the rbenv installation you did as root? Who did you try to install rbenv for the current user? did you encounter any issue? be more specific if you have an error as a normal non-root user. – arieljuod Dec 14 '19 at 15:49
  • @arieljuod I shifted to Windows and everything goes fine but when I try to use rails db:migrate, it stucks. – SudeepShakya Dec 14 '19 at 16:06
  • I haven't use windows for the last 5 years, I only know it doesn't work good for rails development but I can't help you there. Personally I would try to fix the linux rbenv installation (or try RVM instead of rbenv) – arieljuod Dec 14 '19 at 16:07
  • See "[Using rbenv doesn't work with sudo?](https://stackoverflow.com/a/19074129/128421)" – the Tin Man Dec 15 '19 at 00:08

1 Answers1

1

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).