Require different core extensions correctly.

The begin rescue block is specifically to catch LoadError while loading
i18n gem. Other core extensions, under active support, should be
required outside of the begin rescue block.
rails -> Rails [ci skip]
Merge pull request #10532 from prathamesh-sonpatki/Rails

rails -> Rails [ci skip]
Merge pull request #10531 from waseem/refactor_require

Require different core extensions correctly.
remove redundant var
remove variable and fix warning
Merge pull request #10536 from vipulnsward/fix_exp_warning

remove variable and fix warning
Merge pull request #10535 from vipulnsward/remove_var

remove redundant var