The theoretical description has been proposed for the operation of the spin transistor in the gate-controlled InAs nanowire. The calculated current-voltage characteristics show that the current flowing from the source (spin injector) to the drain (spin detector) oscillates as a function of the gate voltage, which results from the precession of the electron spin caused by the Rashba spin-orbit interaction in the vicinity of the gate. We have studied two operation modes of the spin transistor: (A) the ideal operation mode with the full spin polarization of electrons in the contacts, the zero temperature, and the single conduction channel corresponding to the lowest-energy subband of the transverse motion and (B) the more realistic operation mode with the partial spin polarization of the electrons in the contacts, the room temperature, and the conduction via many transverse subbands taken into account. For mode (A) the spin-polarized current can be switched on/off by the suitable tuning of the gate voltage, for mode (B) the current also exhibits the pronounced oscillations but with no-zero minimal values. The computational results obtained for mode (B) have been compared with the recent experimental data and a good agreement has been found.