New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running rbenv with sudo #60

Closed
marcelokanzaki opened this Issue Aug 24, 2011 · 8 comments

Comments

Projects
None yet
9 participants
@marcelokanzaki
Copy link

marcelokanzaki commented Aug 24, 2011

gem install rails
=> dont have permissions to write in the gems directory

sudo gem install rails
=> unknow gem command

wtf?

@graywh

This comment has been minimized.

Copy link

graywh commented Aug 24, 2011

sudo doesn't inherit your $PATH

Instead, you can sudo $(rbenv which gem) command.

@sstephenson

This comment has been minimized.

Copy link
Contributor

sstephenson commented Sep 9, 2011

Don't use rbenv with sudo.

@sstephenson sstephenson closed this Sep 9, 2011

@letronje

This comment has been minimized.

Copy link

letronje commented Oct 17, 2011

How do i run passenger on port 80 with rbenv ? I need sudo right ?

@jrgifford

This comment has been minimized.

Copy link

jrgifford commented Oct 17, 2011

@letronje Yeah, if you're running anything on a port below 100 you need root privs.

I'd recommend using apache and mod_proxy, but that's just me.

@grosser

This comment has been minimized.

Copy link

grosser commented Oct 18, 2011

function rbenvsudo(){
  executable=$1
  shift 1
  sudo $(rbenv which $executable) $* 
}
@mrrooijen

This comment has been minimized.

Copy link

mrrooijen commented Apr 3, 2012

Actually I think anything under port 1024 requires root privileges, including 443 for the http protocol. Also, nice function @grosser,very handy when exporting to for example upstart in /etc/init with the foreman gem or binding app servers on < 1024 ports. Would be nice is this function was included in rbenv, like rvm has rvmsudo. Any chance you might incorporate such a function or is that out of scope @sstephenson?

@hgupta

This comment has been minimized.

Copy link

hgupta commented Dec 23, 2013

I just stared using Bluepill to manage my delayed_jobs, but it can be loaded only as sudo. Although there is a gem called rbenv-sudo, I was hoping if @sstephenson could permanently add such function as a part of existing repo. If it is out of scope, I would very much like to know why authors think that adding sudo is a bad idea.

@mislav

This comment has been minimized.

Copy link
Member

mislav commented Dec 23, 2013

@hgupta If the rbenv-sudo plugin solves your problem, I would say use the plugin. We didn't provide functionality to facilitate running rbenv through sude because a lot of people are mistakenly using sudo for scenarios where that is harmful to them in the long run. Most rbenv users shouldn't need sudo, and we don't maintain features that most of our users won't need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment