Basic information on what to get and how to put it together
A motor can be used as a generator.
For my set-up, I use a 12 volt permanent fixed magnetic motor link.
Another option is to use a hub-motor used in electric bikes.
You will need some way to prop the rear tire of your bicycle off the ground. A bicycle training stand works great.
Three ways to spin the generator shaft:
#1 You can use a rubber-belt. Remove the rear tire and tube. The belt can be guided by the rim of the bicycle's rear wheel.
#2 You can attached a 'bushing' to the generator's shaft. Position it to be spun by having it rub the edge of the inflated bike wheel.
#3 Use a hub motor. This is the most efficient method. The down-side is the weight of the hub motor will be part of the bicycle.

Fuses are necessary to keep things safe. Always put a fuse or breaker switch on the positive lead wire.
You will need a 'charger regulator'; which levels the electricity and restricts the electricity from flowing back to the generator.
From the regulator you can use a 12 volt
deep cycle / marine battery to save the electricity you produce.
The generator is producing DC (Direct Current).
Your smaller battery powered devices use DC. Most larger appliances use AC 
(Alternating Current).
To power AC devices (like a sewing machine) y
ou will need a 'power inverter' to convert the DC to AC.
To connect the generator, fuses, the charger regulator, the battery, and the inverter you will need at least 12 feet of 10 gauge wire.

To give you an idea of how much electricity can be produced :
  My sewing machine (without the light on) is rated at 50 watts and consumes 1 amp every hour. My bicycle electric generator can make 1 amp every 10 minutes. That means for every 10 minutes of peddling, I can sew for 1 hour.
  I also hook my sewing machine up to a 50 watt solar panel. On a good day in Tucson, Arizona - I'll be lucky to get 4 1/2 amps from the sun for the entire day.  That's 4 1/2 hours of sewing per day with just the solar panel.
Click here to see the >>> Solar Sewing Rover

Use FUSES !!!!!  their small price and will save you hundreds of $$$
(always attach fuses to the +positive wire)

↓ Powering a sewing machine with a bicycle generator ↓

Bicycle generator at Venice Beach, California

 A slightly smaller aluminum rim woven through the spokes of the larger rear wheel EXPLAINED :

My bike is my daily rider. I want to be able to ride it normally and change the bike quickly to start producing electricity. (taking the tire and tube off the wheel everytime is too much) I saw a way of attatching and centering a smaller aluminum rim through the spokes of the rear wheel. To do this you will need to drill holes in the smaller rim at the specific points where the spokes line-up. First, place the smaller rim against the larger rim in the approximate center. (opposite the cog and chain drive) As a stabilizing tool, use string to tightly hold the smaller rim to the side of the spokes to the existing rear wheel. Measure the distance at the edge of the smaller rim to the edge of the larger rim carefully pushing the rim around until it is evenly spread. With a fine sharpee-type-pen, make a mark on the smaller rim next to each touching spoke. After marking, remove the string, and score each mark with a hammer and scoring tool. Drill the holes with a drill bit ever slightly larger than the diameter of the spokes (these drill bits break easily, so bring extras). After drilling, use a metal grinder to cut-out the area on the sides-of-the-smaller-rim around where the holes are - this provides a straight(er) line to weave in the spokes of the main wheel. The lower you grind the rim, the easier it will be to true the wheel, but also potentially weaken the structure of the rim- I took off about 6 to 9 millimeters. Don't forget to also grind a place for the air valve! Using a swivel screwdriver-truing tool that turns the spoke nipple from the top was most helpful.

Links to people who have figured out how to make Bicycle electric generators: