“Don't run bundler as root” - what is the exact difference made by using root?

后端 未结 1 1513
难免孤独
难免孤独 2020-12-31 04:27

If you run ruby bundler from the command line while logged in as root, you get the following warning:

Don\'t run Bundler as root. Bundler can ask for

相关标签:
1条回答
  • 2020-12-31 04:52

    So I had to dig into the git log history of bundler's repo, because GitHub doesn't allow search in git commits messages anymore.

    The commit c1b3fd165b2ec97fb254a76eaa3900bc4857a357 says :

    Print warning when bundler is run by root. When a user runs bundle install with sudo bundler will print a warning, letting them know of potential consequences.

    closes #2936

    Reading this issue, you understand the real reason you should not use the root user:

    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.

    0 讨论(0)
提交回复
热议问题