How to Chef things that don't exist yet
I'd go with node.run_state to store a transient variable in a run and define it in a ruby_block so it happens at converge time, something like this:

yum_package 'somepackage'

ruby_block 'set myvar' do
  block do
    node.run_state['my_var'] = Mixlib::ShellOut.new('/bin/somecommand').run_command.stdout.strip
  end
end


As far as I know requiring 'mixlib/shellout' is not necessary.