I'll try to restate correctly what user1938185 wanted to say. Because $\Bbb Q$ is a field, solving any linear system cannot force your variables to take values outside$~\Bbb Q$. By comparison consider a set of linear equations in a real vector space (each one has a hyperplane of solutions, you are trying to find the intersection of those solution sets). I hope you would be mighty surprised if you were told that no solution exists (the intersection is empty) but that a generalised solution can be constructed by taking complex coordinates instread of real ones. Indeed this can never happen (although such a thing may happen for polynomial equations; indeed the complex numbers are created by "inventing" a solution to the quadratic equation $x^2=-1$).
If you look at the operations you have learned to solve linear equations (forming linear combinations of equations, Gaussian elimination, substitution, whatever), you will see that they only involve arithmetic operations (including division after checking that it is not by zero) which can never cause you to go outside of a field$~F$ that contains the coefficients of the original system (in your question that would be $F=\Bbb Q$). Either you and up with a plain contradiction of the type $0x=1$, which won't have a solution either in whatever field larger than$~F$ you may invent, or you found a unique solution using arithmetic operations (which will then only involve values in$~F$), or you get multiple solutions, where some variables can be chosen freely and the other ones can be expressed in terms of them by arithmetic operations. Only in the final situation can it occur that you also have solutions where variables take values outside$~F$ (the freely chosen ones can certainly be taken that way), but you don't need to do this: if all freely chosen variables are taken to have values in$~F$, then all variables will take variables in$~F$.
To summarize, if you have a system of linear equations with coefficients in a subfield$~F$ of a strictly larger field$~K$, then the existence of solutions with values in$~K$ implies the existence of solutions with values in$~F$. In particular if there is a unique solution with values in$~K$, it actually has values in$~F$. You can apply this in amongst others with $F=\Bbb Q$, $K=\Bbb R$, or with $F=\Bbb R$, $K=\Bbb C$.