Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Print warning when bundler is run by root #2936

Closed
indirect opened this issue Mar 24, 2014 · 2 comments
Closed

Print warning when bundler is run by root #2936

indirect opened this issue Mar 24, 2014 · 2 comments

Comments

@indirect
Copy link
Member

Running sudo bundle install can cause huge and cascading problems for users trying to install gems on OS X into the system gems. We should print a warning and explain that Bundler will prompt for sudo if it's needed. We should also warn people that sudo bundle will break git gems, because they have to be writable by the user that Bundler runs as.

@indirect indirect added the small label Mar 26, 2014
thejonanshow added a commit to thejonanshow/bundler that referenced this issue Apr 3, 2014
When a user runs bundle install with sudo bundler will print a warning, letting
them know of potential consequences.

This closes rubygems#2936.
indirect pushed a commit that referenced this issue Apr 7, 2014
When a user runs bundle install with sudo bundler will print a warning, letting
them know of potential consequences.

closes #2936
@assarbad
Copy link

assarbad commented May 24, 2016

Just wondering. I am not a Ruby buff, but can't you check the equivalent of running uname -s on the shell (and capturing its output) against a value of "Darwin" and only in that case issue the warning?

Thanks for reading.

This StackOverflow post brought me here.

@colby-swandale
Copy link
Member

@ioquatix There is a config option silence_root_warning or ENV var BUNDLE_SILENCE_ROOT_WARNING that will silence the sudo warning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants