Step 1.
Boot the Raspberry Pi without the WiFi adapter plugged in.
Step 2.
vi /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "ssid"
wpa-psk "password"
Step 3.
Plug in WiFi adapter and Reboot