Yes you can.
Give the text a fill and stroke of none.
Go to the Appearance panel and add a new fill and use a gradient for this fill.
i did it but it turns to black, not to the gradient
It can be done with live text.
When you add a new fill in the Appearance panel, the default is black.
You need to click on the black to change it to a gradient.
Top: standard black text, Middle: no fill, Bottom: gradient fill added in the Appearance panel.
What the OP may be missing is that one has to select the entire text object, as opposed to selecting the text inside it,
Yes, I hope the picture explains this.
You used the Text tool to select the text.
Use the Selection arrow tool (V) to click on the text object.
still not working
Good to hear you got it working!
only when it's outlined it works. not on the plain text
(it is possible in InDesign)