Twist together the black wire from the wall to the black wire from the light and cap these as well. Installing a ceiling fan where there is no ground wire mike if a ground wire is not available then it is best to run a ground wire from another electrical circuit that has a ground wire.

Installing Ceiling Light Without Box Mycoffeepot Org
No ground wire for ceiling fan. The ground wire carries displaced electricity away to reduce the risk of electrical shock if lets say the metal parts of the ceiling fan or any other appliance or part attached to your electrical system becomes accidentally charged with electricity. Depending on the age of the home and if the home is older then it may be that many other circuits do not have a ground wire as well. The ground wire carries displaced electricity away to reduce the risk of electrical shock if lets say the metal parts of the ceiling fan or any other appliance or part attached to your electrical system becomes accidentally charged with electricity. The installation of the ceiling fan without the ground wire will not affect the performance of the ceiling fan however this safety system that is provided through the ground system will not be available. If your light does not have a black wire due to its age then attach the black electrical wire to the gold screw on the fixture. You can take one of two approaches when installing a ceiling fan on a branch circuit that has no ground wire.
The ground wire doesnt carry any electrical current unless there is a problem in your electrical system. Step 4 run your ground wire from the light conduit box to the nearest copper water pipe. The approach recommended by most professional electricians is to replace the standard. So if you wire your fan without the ground wire it will still work properly. So if you wire your fan without the ground wire it will still work properly. However the added safety of the ground wire will not be.
I have provided the following links that lead to fully detailed information on this website that will assist you with your electrical question.