The acceleration \( a \) of the system is given by:
\[ a = \frac{(m_1 - m_2)g}{m_1 + m_2} = \frac{g}{8}. \]This implies:
\[ 8m_1 - 8m_2 = m_1 + m_2. \]Rearrange terms:
\[ 7m_1 = 9m_2. \]Thus, the ratio of \( m_1 \) to \( m_2 \) is:
\[ \frac{m_1}{m_2} = \frac{9}{7}. \]Therefore, the answer is:
\[ \frac{9}{7}. \]