Try changing your workflow to this:
wf = OpenStudio::Runmanager::Workflow.new("modeltoidf->expandobjects->energypluspreprocess->energyplus")