Airdrieonians' reward for Saturday's win over Stirling Albion is a home tie against Rangers in the second round of the Scottish League Cup.
Hearts will travel to Forfar while Hibernian host Stranraer, Partick Thistle have home advantage over Falkirk and Motherwell go to East Fife.
Ross County host Ayr United and Berwick Rangers will try to upset Gary Locke's Kilmarnock at Rugby Park.
Dundee were drawn away to Dunfermline and Queen of the South take on Morton.
Dundee, Hamilton Accies, Partick Thistle, Ross County, Kilmarnock, Motherwell and St Mirren joined the draw at the second round stage, along with the 15 winners of the first-round ties.
Trophy holders Celtic enter at the third-round stage, along with Aberdeen, Inverness CT, St Johnstone and Dundee United.
League Cup second round draw:
Ross County v Ayr United
Forfar Athletic v Heart of Midlothian
Kilmarnock v Berwick Rangers
Raith Rovers v Hamilton Academical
Queen of the South v Morton
Dunfermline Athletic v Dundee
Partick Thistle v Falkirk
East Fife v Motherwell
Hibernian v Stranraer
Airdrieonians v Rangers
St Mirren v Livingston
Ties to be played on 25 and 26 August.