RiotGamesCookbooks / rbenv-cookbook

Installs and configures rbenv
http://community.opscode.com/cookbooks/rbenv
Apache License 2.0
137 stars 109 forks source link

ruby_block[initialize_rbenv] only called when template[/etc/profile.d/rbenv.sh] is updated #87

Open caleb opened 10 years ago

caleb commented 10 years ago

This might be on purpose, but I noticed that the cookbook only sets up the ENV for rbenv when template[/etc/profile.d/rbenv.sh] is updated.

Is this on purpose? It seems like the first chef-client run the ENV would include rbenv and therefore cookbooks that use gem_package would install gems into the default rbenv ruby.

But after that first run, when the template doesn't change, and the ruby_block[initialize_rbenv] isn't run, and the rbenv variables aren't added to ENV, and therefore any cookbook that uses gem_package would then default to the system ruby.

I know I should be using the rbenv gem package resource, and I am, but I ran into an issue where another cookbook was using gem_package and I saw that the rbenv-cookbook does set up the environment, but only when the above template changes.