By pigeonhole principle, three of the segments have the same length, say $a$ (not necessarily $a>b$). If they do not form an equilateral triangle, then let it be $ABCD$ with $AB=BC=CD=a$, or $AB=AC=AD=a$. Assume the former first. If $DA=a$, the square is the only possible, with $\frac{a}{b}=\sqrt2$. Otherwise, $AC=BD=DA=b$, so it forms the 4 vertices of a pentagon, with $\frac{a}{b}=\frac{1+\sqrt5}{2}$. Now suppose $AB=AC=AD$. If any of the segments have length $a$, then an equilateral triangle is formed. Thus $BC=CD=DB=b$, and $\frac{a}{b}=\sqrt3$. Now we assume $AB=BC=CA=a$. If the remaining 3 segments are length $b$, it is the same as before. If one of them is $a$, assume $AD=a$, then $BD=DC=b$, so either $A$ lies inside ($\frac{a}{b}=\frac{1}{\sqrt{2-\sqrt3}}$, too lazy to simplify) or outside (same ratio as inside) the triangle $BCD$. If 2 of the segments are $a$, say $AD=BD=a$, then $\frac{a}{b}=\sqrt3$. All segments cannot be equal. So there are a few answers: $\sqrt2,\sqrt3, \frac{1+\sqrt5}{2},\frac{1}{\sqrt{2-\sqrt3}}$