Git Product home page Git Product logo

Comments (10)

axsuul avatar axsuul commented on September 28, 2024

Ever figure this one out?

from ruby_rbenv.

hedgehog avatar hedgehog commented on September 28, 2024

@axsuul, not yet.
I think the solution lies in the discussion of this issue:

http://tickets.opscode.com/browse/CHEF-2288

from ruby_rbenv.

axsuul avatar axsuul commented on September 28, 2024

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.

axsuul avatar axsuul commented on September 28, 2024

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.

justsee avatar justsee commented on September 28, 2024

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.

stevenharman avatar stevenharman commented on September 28, 2024

@axsuul Did you have any plans to push those changes back upstream?

from ruby_rbenv.

CloCkWeRX avatar CloCkWeRX commented on September 28, 2024

Yeah, pull requests welcome !

from ruby_rbenv.

axsuul avatar axsuul commented on September 28, 2024

I'm now using this fork: https://github.com/muskox/chef-rbenv due to this issue: #98

from ruby_rbenv.

CloCkWeRX avatar CloCkWeRX commented on September 28, 2024

#98 is fixed here also

from ruby_rbenv.

lock avatar lock commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.