If you can locate a small generator that runs on gas, and, if you have the mechanical skills required to take it apart, you will probably see a shaft on the generator-side of the unit which connects to the motor side of it.
From that shaft, you would be able to attach a bicycle sprocket to it. Now, comes the hard part. You will need metal-working skills and tools to fabricate a mount for the generator portion to attach to the bike-frame.
A side note: The kind of generator that you would want to use is one that runs on around 1/4 horse power - anything more than that and you would have too much difficulty spinning your legs fast enough to actually generate any power.
A better choice would be to use renewable-energy to run the generator - like a steady flowing stream of water.
I would down scale the generator a little from a gas verson.
Most gasoline versions are intended to output 110 or 220 volts AC current at something approximating 60 cycles.
A bicycle charger for charging batteries you would be much better off with permanent magnet generator, or maybe even a car alternator rewired for the slower speeds you would produce with a bicycle.
Lets not get ahead of ourselves here,
You would probably be better off with a 'Stationary Bike' that had a fairly heavy flywheel rather than an actual bicycle tire.
Flywheels store and use energy much more effectively than a light weight bike tire.
The generator should be one that either puts out directly in the voltage/amperage range you need to charge your battery (like a car alternator for charging automotive type batteries)
A generator that outputs in a standard voltage so you can use adapters/transformers to get the current you need for charging your batteries.
Battery chargers come in all shapes and sizes, everything from cigarette lighter plug in kind for smaller batteries (flashlights, radios, lap tops, ect.) to chargers that take 440 volts in 3 phase!
As for the actual building, that's pretty straight forward...
A smaller generator mounted so the shaft is turned by a bike tire is the most simple, and pretty effective if you only have small batteries to charge.
This kind attaches to your bike frame or forks, and will charge your batteries when you are riding someplace.
I can't guarantee the current output or the sustainability, but it's cheap!
These little dynamo generators usually fall apart.
If you can find a good one, they do OK, but most of the time they are made in China and they are JUNK...
You would be better off finding a small permanent magnet motor in something you discarded and making your own generator with that....
This rig is for converting your bike to a stationary rig.
This lifts the rear wheel by the axle, and the tire turns the generator.
Personally, I'd probably find a way to mount the generator on the bike and charge my stuff while I was going down the road... http://www.econvergence.net/electro.htm
Here are some links you might want to check out for ideas if you want to build your own,
I'd use a permanent magnet motor from some appliance, and use it for a generator.
You know, much like lawnmowers use the flywheel magnets to produce current to charge the battery.
Bicycles aren't the idea way to do this, but they will work.
The 'Ideal' way would be to have a heavy flywheel, like on the older exercise bikes, turn the generator.
Good, heavy flywheel will smooth out the small increases and decreases in speed as the pedal crank came around.
Anyway, I tinkered with this a few years ago,
Flywheel exercise bike, permanent magnet motor off a sewing machine, 3 amp Rectifier bridge (about $3 at Radio Shack), didn't make much juice, but it would sure charge up rechargeable flashlight batteries or cell phones we have now!
Back then everything just took SO MUCH juice it wasn't practical for all the pedaling.... (and I'm even older now!)
I would think a Lawn mower starter would work, since it's permanent magnet & commutator rectified, all you would need is a capacitor to smooth out the ripple and it should produce fine at relatively low RPM...
Anyway, if anyone is going to try it, I'd be glad to help with the wiring kinks...
And yes, a solar panel will put out more current for a longer period of time than you can pedal...
This might be a back up for a very small production system in case the sun wasn't out for several days in a row!
Bike-style generators have low yield for the amount of time/work you exert. They'll make you REALLY appreciate a fueled generator. I've seen a a few military models are still available, tho. Mostly British, I think.