No gradient really yet, just a bunch of vertical lines with colors changing from red to violet in \foreach loop.
\documentclass{article}
\usepackage[named]{xcolor}
\usepackage{pgffor}
\begin{document}
\foreach \x in {red,orange,yellow,green,blue,violet} {%
\textcolor{\x}{\rule{3pt}{\textheight}}%
}
\end{document}
And another version with TikZ and a vertical shading with \pgfdeclareverticalshading, which is taken from the pgf manual (see page 1088 of current manual version). It starts from red to blue but the shading is different, so shading angle=270 is used in order to rotate the order of the direction, otherwise use shading angle=90. If a vertical shading is desired, omit the shading angle key.
\documentclass{article}
\usepackage[named]{xcolor}
\usepackage{pgffor}
\usepackage{tikz}
\usetikzlibrary{shadings}
\pgfdeclareverticalshading{rainbow}{100bp}
{color(0bp)=(red); color(25bp)=(red); color(35bp)=(yellow);
color(45bp)=(green); color(55bp)=(cyan); color(65bp)=(blue);
color(75bp)=(violet); color(100bp)=(violet)}
\begin{document}
\begin{tikzpicture}
\shade[shading=rainbow,shading angle=270] (0,0) rectangle (5cm,\textheight);
\end{tikzpicture}
\end{document}
