GFCI works fine on a 2-wire circuit, its just your typical tester that wont work. The tester needs a ground to be able to simulate a leak to cause it to trip. It will still trip if there is an actual current leak or if you use the device test button which does not require a ground to work.
Will GFCI work without ground wire?
A GFCI does not need a ground wire in order to trip properly. A GFCI simply trips when a fault is detected on the neutral wire. An ungrounded outlet will not trip using your tester.
Can I use a GFCI on an ungrounded circuit?
GFCIs can be used in place of ungrounded receptacles AND used for those ungrounded receptacles down line on the same branch circuit. All receptacles must be labeled GFCI protected AND Ungrounded Equipment in such cases.
What can I use if I dont have a green ground wire?
The ground wire doesnt carry any electrical current (unless there is a problem in your electrical system). 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 present.