Comments (10)
Ever figure this one out?
from ruby_rbenv.
@axsuul, not yet.
I think the solution lies in the discussion of this issue:
http://tickets.opscode.com/browse/CHEF-2288
from ruby_rbenv.
I actually got around this issue, sorry I never came back to update this. See this commit in my fork axsuul@f5b1477
It has to do with modifying sudoers
. It's not the cleanest solution but at least it works.
from ruby_rbenv.
Oops! I totally referred to the wrong commit. Sorry it's been awhile. I believe this is the correct commit: axsuul@c0c42fe
Were you running into this issue when installing for multiple users?
from ruby_rbenv.
I experienced this issue when doing app deploys with Chef. If I ran Chef as root from /root
, then it would fail with:
STDERR: rbenv: cannot change working directory to `/root'
I have an execute resource which runs as a non-root user, and it failed when running rbenv exec bundle exec ...
. Setting the environment PWD, and doing cwd in the Chef execute resource did not resolve the issue.
Running chef-client
from an accessible directory to the target user obviously avoided the issue, but wasn't sensible.
If you look at the rbenv source line where the error is generated, you'll see that RBENV_DIR
is the variable responsible. Setting that to an appropriate directory resolves this issue, as otherwise rbenv will set it to pwd, which returns /root. For instance
execute "rbenv exec bundle install --path=/vendor/bundle --deployment --without #{common_groups} --binstubs" do
cwd new_resource.release_path
user new_resource.owner
environment new_resource.environment.update({
"RBENV_DIR" => new_resource.release_path
})
end
from ruby_rbenv.
@axsuul Did you have any plans to push those changes back upstream?
from ruby_rbenv.
Yeah, pull requests welcome !
from ruby_rbenv.
I'm now using this fork: https://github.com/muskox/chef-rbenv due to this issue: #98
from ruby_rbenv.
#98 is fixed here also
from ruby_rbenv.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from ruby_rbenv.
Related Issues (20)
- Allow users to change the Git URL for ruby-build plugin HOT 1
- rbenv_gem resource is not compatible with Chef 13 HOT 10
- chef-client run fails to update rbenv due to failing git command HOT 15
- Add CircleCI badge to README HOT 1
- change group for user_install HOT 5
- Need to override options to remove `--no-rdoc` and `--no-ri` for newer versions of bundler HOT 2
- It should be possible to use the rbenv_script resource as a non-root user, with a system-wide installation HOT 5
- Debian 10 package dependencies outdated ? HOT 2
- Dangerfile should use failure instead of fail HOT 1
- Remove .rubocop.yml with Dangerfile
- Update Changelog HOT 1
- Run latest cookstyle
- Update builds to be parallel HOT 2
- https://github.com/sous-chefs/ruby_rbenv/pull/255 not merged properly ? HOT 3
- node.run_state['root_path'] conflicts with pyenv cookbook HOT 4
- Cannot force update branch error is back HOT 6
- ruby_rbenv Chef 17 compatibility
- Use resource partials
- Dependency Dashboard
- Failing to install rbenv on CentOS 9 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby_rbenv.