Purple-Devs / rbenv-binstubs

A Bundler binstubs Plugin for rbenv [maintainer wanted]
281 stars 11 forks source link

Requires write permissions to $RBENV_ROOT #21

Open stefansundin opened 9 years ago

stefansundin commented 9 years ago

Hi.

I am trying to use this plugin in an environment where rbenv is installed into /usr/local. Unfortunately since normal users do not have write permissions to $RBENV_ROOT/bundles, I get this error:

$ bundle
/usr/local/rbenv/plugins/rbenv-binstubs/etc/rbenv.d/exec/rbenv-binstubs.bash: line 16: /usr/local/rbenv/bundles.new.15: Permission denied

I first tried chmod 666 /usr/local/rbenv/bundles, but since the code writes a new temporary file before it moves it to that location, it doesn't work. https://github.com/ianheggie/rbenv-binstubs/blob/master/etc/rbenv.d/exec/rbenv-binstubs.bash#L15

I think it would be simplest to introduce an option that disables this optimization. Maybe an environment variable. Or maybe use the $HOME/.rbenv-bundles or a path which we are fairly certain to have write-permissions to.

Thanks!

chino commented 8 years ago

+1... being affected as well

ianheggie commented 8 years ago

It is not a use case I have thought about.

Either of you want to write up tests and some code to solve the problem? I no longer use rbenv myself.