I am running into a strange problem that SP.Ribbon.js is not getting loaded.
Normally if I view page source, there will be a bunch of RegisterSod(...) lines that loads a bunch of sharepoint javascript files on demand, including SP.Ribbon.js. However most of the other RegisterSod lines are still there (like for sp.core.js, sp.runtime.js, etc), but the one loads sp.ribbon.js disappeared.
Our custom master page could be a possible problem, but it works in 3 out of 5 environments, so I'm thinking it has more to do with configuration or other environmental problems. But I have no idea where to look, and no idea where is the corresponding code for those core SP script files.
I hope the above makes sense, and any help will be much appreciated!
Update: In the broken environments, if I change the web's UIVersion to 4 (it was changed to 3), the missing js files (cui.js/sp.ribbon.js) will be loaded. This would not be the optimal solution however, as it breaks a lot of the html and css layouts.
Plus, UIVersion being 3 does not seem to cause those js files to be missing in other environments, only if I can figure out why...