You go outside the city and through all the grass to the huge bridge and talk to steven and beat the Pokemon that pops up and steven will give you a machine so you can see the barrier so you can get through
You have to leave the city and cross the grass. there is a bridge. cross it and you will see steven. talk to him and he will give you a strange machine that will let you cross the invisible object to the fortree gym.