Skip to content

Commit

Permalink
Merge pull request #42 from apptentive/master
Browse files Browse the repository at this point in the history
Fix for #16, load rbenv environment after install
  • Loading branch information
fnichol committed Mar 3, 2014
2 parents c0dc166 + f8c941f commit 26f3265
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libraries/chef_rbenv_recipe_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def install_rbenv_pkg_prereqs
def install_or_upgrade_rbenv(opts = {})
git_deploy_rbenv opts
initialize_rbenv opts
add_rbenv_to_PATH
end

private
Expand Down Expand Up @@ -86,6 +87,15 @@ def initialize_rbenv(opts)

log "rbenv-post-init-#{opts[:user] || 'system'}"
end

def add_rbenv_to_PATH
ruby_block "Add rbenv to PATH" do
block do
rbenv_root = node['rbenv']['root_path']
ENV['PATH'] = "#{rbenv_root}/shims:#{rbenv_root}/bin:#{ENV['PATH']}"
end
end
end
end
end
end

0 comments on commit 26f3265

Please sign in to comment.