{"action":"created","issue":{"url":"https://api.github.com/repos/poise/poise-ruby/issues/3","labels_url":"https://api.github.com/repos/poise/poise-ruby/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/poise/poise-ruby/issues/3/comments","events_url":"https://api.github.com/repos/poise/poise-ruby/issues/3/events","html_url":"https://github.com/poise/poise-ruby/issues/3","id":27915537,"number":3,"title":"reload ruby ohai plugin when run as recipe","user":{"login":"josephholsten","id":7495,"avatar_url":"https://avatars.githubusercontent.com/u/7495?v=3","gravatar_id":"","url":"https://api.github.com/users/josephholsten","html_url":"https://github.com/josephholsten","followers_url":"https://api.github.com/users/josephholsten/followers","following_url":"https://api.github.com/users/josephholsten/following{/other_user}","gists_url":"https://api.github.com/users/josephholsten/gists{/gist_id}","starred_url":"https://api.github.com/users/josephholsten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephholsten/subscriptions","organizations_url":"https://api.github.com/users/josephholsten/orgs","repos_url":"https://api.github.com/users/josephholsten/repos","events_url":"https://api.github.com/users/josephholsten/events{/privacy}","received_events_url":"https://api.github.com/users/josephholsten/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-02-19T22:25:44Z","updated_at":"2015-05-29T06:20:39Z","closed_at":"2015-05-29T06:20:39Z","body":"People using poise-ruby as a recipe probably want the ruby to be run as their main ruby. So it would be useful to rerun ohai's ruby plugin, presumably after adding setting `$PATH`. e.g.\r\n\r\n```ruby\r\ninclude_recipe 'poise-ruby'\r\n\r\npoise_ruby_path = \"/opt/#{node['poise-ruby']['ruby']}/bin\"\r\nENV['PATH'] = \"#{poise_ruby_path}:#{ENV['PATH']}\"\r\n\r\nexecute 'add poise-ruby to /etc/environment' do\r\n  command <<-EOS\r\n    TEMP=`mktemp -t environment.XXXXXXXXXX` || exit 1\r\n    cat /etc/environment |\r\n    sed 's/PATH=.*$/PATH=\"#{ENV['PATH'].gsub('/','\\/')}\"/' > $TEMP &&\r\n    cat $TEMP > /etc/environment\r\n    rm $TEMP\r\n  EOS\r\n\r\n  not_if \"grep 'PATH=.*#{poise_ruby_path}'  /etc/environment\"\r\nend\r\n\r\nohai 'ruby' do\r\n  plugin 'ruby'\r\n  action :reload\r\nend\r\n```\r\n\r\nI've had to use this terrible hack to allow the [`passenger_apache2`](https://github.com/opscode-cookbooks/passenger_apache2) cookbook to auto discover the right ruby."},"comment":{"url":"https://api.github.com/repos/poise/poise-ruby/issues/comments/106704713","html_url":"https://github.com/poise/poise-ruby/issues/3#issuecomment-106704713","issue_url":"https://api.github.com/repos/poise/poise-ruby/issues/3","id":106704713,"user":{"login":"coderanger","id":128243,"avatar_url":"https://avatars.githubusercontent.com/u/128243?v=3","gravatar_id":"","url":"https://api.github.com/users/coderanger","html_url":"https://github.com/coderanger","followers_url":"https://api.github.com/users/coderanger/followers","following_url":"https://api.github.com/users/coderanger/following{/other_user}","gists_url":"https://api.github.com/users/coderanger/gists{/gist_id}","starred_url":"https://api.github.com/users/coderanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderanger/subscriptions","organizations_url":"https://api.github.com/users/coderanger/orgs","repos_url":"https://api.github.com/users/coderanger/repos","events_url":"https://api.github.com/users/coderanger/events{/privacy}","received_events_url":"https://api.github.com/users/coderanger/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T06:20:39Z","updated_at":"2015-05-29T06:20:39Z","body":"Closing old tickets as this cookbook has pivoted."}}