For a general input signal and a first order system, you may solve the differential equation via the integrating factor, \$\small (IF)\$, method* or the Laplace transform, amongst others. The analysis below uses the \$\small IF\$ method.
\$ ^*\$See edit, below, for an explanation of the integrating factor method.
Given the circuit you describe, the loop equation is:
\$v_i=v_R+v_C\$
\$v_i=iR+\frac{1}{C}\int i\:dt\$
Differentiating:
\$\large \frac{dv_i}{dt}\small = R\large \frac{di}{dt}+\frac{i}{C} \$
Rearranging:
\$\large \frac{di}{dt}+ \frac{i}{RC}= \frac{1}{R}\large \frac{dv_i}{dt} \$
Noting that \$\small \tau=RC\$:
\$\large \frac{di}{dt}+ \frac{i}{\tau}= \frac{1}{R}\large \frac{dv_i}{dt} \$
In your particular case, \$ v_i\$ is a ramp, thus: \$ v_i= \small Kt\$, where \$\small K\$ is the slope of the ramp.
Hence \$\large \frac{dv_i}{dt} = \small K\$, and the equation to be solved by the \$\small IF\$ method is:
\$\large \frac{di}{dt}+ \frac{i}{\tau}= \frac{K}{R} \$
The \$\small IF\$ is:
\$\small IF=\large e^{\int \frac{1}{\tau}dt}=e^{\frac{t}{\tau}} \$
Therefore:
\$ i\:e^{\frac{t}{\tau}} =\int \frac{K}{R}e^{\frac{t}{\tau}}dt +A\$
\$ i\:e^{\frac{t}{\tau}} =\small KC\: \large e^{\frac{t}{\tau}} +\small A\$
\$ i =\small KC\: +\small A \large \large e^{-\frac{t}{\tau}}\$
Assuming initial conditions are zero, \$\small A=-KC \$, hence:
\$ i =\small KC\:(1-\large e^{-\frac{t}{\tau}}) \$
and
\$ v_c =\small K\:(t-\tau + \tau e^{-\frac{t}{\tau}}) \$
......................................................................................................................................................
Edit: Solving 1st order ordinary differential equations (ODE) by the Integrating Factor (\$\small IF\$) method:
For the ODE:
\$ \frac{dy}{dt}\small +Py=Q\$, where \$\small P\$ and \$\small Q\$ are functions of \$\small t\$ (which may be constants), we follow the steps:
Determine the integrating factor: \$\small IF= \large e\small ^ {\int P\:dt}\$
The general solution is then found by solving: \$\small y. IF=\large \int \small Q.IF\: dt + A\$, where \$\small A\$ is an arbitrary constant.
Determine \$\small A\$ from the initial condition or a boundary condition, if known.
For example, the ODE: \$ \frac{dy}{dt}+2y=3\$, with \$\small y(0)=5\$
Solution: we identify \$\small P=2,\:Q=3\$
Therefore
\$\small IF= e^ {\int 2\:dt} = e^{2t}\$
Hence
\$\small y\: e^{2t}=\large \int \small 3\:e^{2t}\: dt + A\$
\$\small y\: e^{2t}= \frac{3}{2}\:e^{2t}\: + A\$
Dividing through by \$\small e^{2t}\$
\$\small y= 1.5 + Ae^{-2t}\$
Applying the initial condition:
\$\small y(0)=5= 1.5 + A\$; hence \$\small A=3.5\$
Giving: \$ y= 1.5 + 3.5e^{-2t}\$