This paper analyzes the determinants behind the spatial distribution of the LGBT population in the U.S. We relate the size of the present-day LGBT population to the discovery of gold mines during the 19th century gold rushes. Comparing the surroundings of these gold mines to other current and former mining counties, we find that there are currently 10-15% more same-sex couples in counties in which gold discoveries were made during the gold rushes. We also provide empirical evidence that residents of gold rush counties still have more favorable attitudes toward homosexuality nowadays. Our findings are consistent with two mechanisms. First, gold rushes led to a large (temporary) increase in the male-to-female ratio. Second, we show that gold rush counties were less likely to house a notable place of worship at the time of the discovery (and in the following decades) and are currently less religious, suggesting a role of institutions in shaping attitudes and norms.