To socket a gem you must have within your inventory both the gem and a unique weapon with an empty socket of the same type (runefused / netherfused).
With your inventory open, left click on the gem so that it anchors to your cursor. Then, simply left click on the weapon you would like to socket. The gem will disappear from your cursor and your unique weapon will be socketed.