The answer is "no" as was shown by David Hartley. His counterexample is the Warsaw circle; see https://de.wikipedia.org/wiki/Datei:Warsaw_Circle.png, How to show Warsaw circle is non-contractible?.
Let us nevertheless say a little bit more about compactifications of $\mathbb{R}$.
Your question is related to https://mathoverflow.net/q/95748. In Dave L Renfro's comment you find a reference to
Kenneth D. Magill, Countable compactifications, Canadian Journal of Mathematics 18 (1966), 616-620
https://cms.math.ca/openaccess/cjm/v18/cjm1966v18.0616-0620.pdf
Theorem (2.1) of this paper states that for a locally compact $X$, the remainder $\beta X \setminus X$ of the Stone-Cech-compactification $\beta X$ of $X$ has infinitely many connected components if and only if $X$ has an $n$-point compactification for each positive integer $n$.
But Theorem (2.6) of
K. D. Magill, Jr., N-point compactifications. Amer. Math. Monthly 72 (1965), 1075-1081
says that if every compact subset of $X$ is contained in a compact subset whose complement has at most $N$ components, then $X$ has no $n$-point compactification for $n > N$.
For $X = \mathbb{R}$ this implies that there are no $n$-point compactification for $n > 2$. Therefore $\beta \mathbb{R} \setminus \mathbb{R}$ has only finitely many, say $M$, components. We shall show that $M = 2$.
The proof of Theorem (2.1) of the first paper ((2.1.1) $\Rightarrow$ (2.1.2)) shows the following: If $X$ is locally compact and $\beta X \setminus X = \bigcup_{a \in \Lambda} H_a$, where the $H_a$ are the components of $\beta X \setminus X$, then there exists a compactification $\alpha X$ of $X$ such that $\alpha X \setminus X = \Lambda$. For $X = \mathbb{R}$ we know that $\Lambda$ has $M$ elements. Hence $\mathbb{R}$ has an $M$-point compactification, thus $M \le 2$. But $M = 1$ is clearly impossible.
$\beta \mathbb{R}$ is the "maximal" compactification of $\mathbb{R}$, i.e. for any $\alpha \mathbb{R}$ there exist a continuous $f : \beta \mathbb{R} \to \alpha \mathbb{R}$ such that $f(x) = x$ for $x \in \mathbb{R}$. This means that the remainder $\alpha \mathbb{R} \setminus \mathbb{R}$ has one or two components. If it has two components, then there exists $\alpha \mathbb{R} \to [0,1]$. If it has only one component, then such a map cannot exist.
There are plenty of non-equivalent one component compactifications. For example, each compact Hausdorff space $R$ which is the continuous image of $[0,1]$ (which is the remainder of David Hartley's example) occurs as the remainder of such a compactification.
Kenneth D. Magill, Countable compactifications, Canadian Journal of Mathematics 18 (1966), 616-620
https://cms.math.ca/openaccess/cjm/v18/cjm1966v18.0616-0620.pdf
This paper shows that $\mathbb{R}$ has only compactifications with remainder having one, two or uncountably many points. Moreover, the remainder of the Stone-Cech- compactification has only finitely many connected components.
– Paul Frost Dec 08 '18 at 13:54