intellij-rust: IDEA cannot recognize Rust toolchain
The issue is related to the ticket from Zendesk Support.
Environment
- IntelliJ Rust plugin version: 0.2.120.2202-201
- Rust toolchain version: 1.43.0 (4fb7144ed 2020-04-20)
- IDE name and version: IntelliJ IDEA 2020.1 (IU-201.6668.121)
- Operating system: Windows 10 (10.0, amd64)
Problem description
IDEA cannot recognize Rust toolchain though the same toolchain is recognized fine on CLion 2020.1 with the same Rust plugin version installed.
Settings -> Language frameworks -> Rust
toolchain location : E:\dev\rust\cargo\bin
toolchain Version : NA
standard library : (blank)
download via rustup (clicking does nothing)
$ rustup show
Default host: i686-pc-windows-gnu
rustup home: E:\dev\rust
installed toolchains
--------------------
stable-i686-pc-windows-gnu
stable-i686-pc-windows-msvc
stable-x86_64-pc-windows-gnu
active toolchain
----------------
stable-i686-pc-windows-gnu (default)
rustc 1.43.0 (4fb7144ed 2020-04-20)
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 15
- Comments: 36 (8 by maintainers)
I had the same problem.
rustup -V
,rustc -V
,cargo -v
and all 3 were installed. Unfortunately, I forgot to document what versions I was shown, but I think Clion showed rust version 1.43rustup install stable && rustup default stable
fixed the issueI have two extra things that might be of help:
rustup install stable && rustup default stable
, but now IntelliJ shows version 1.45 correctly.Seems to me like an environment configuration problem.
Just because it worked for you does not mean it is the solution to the problem… That’s actually not related to the actual problem, the final results are the same though. The real problem regarded in this issue is that somehow the plugin is not handling the environment variabless
CARGO_HOME
andRUSTUP_HOME
correctly. The only way to get the IDE to recognize them is by launching it via a shell where those vars are set to the custom values, this is cumbersome and not up to the standards of JetBrains tooling in my opinionAgain the same solution, rustup install stable & rustup default stable environment: Win: 11 Clion: 2022.1 rustc 1.60.0 cargo 1.60.0 rustup 1.24.3
For
Toolchain location
I have to change it toD:\rust\.rust\toolchains\stable-x86_64-pc-windows-msvc\bin
to make it work.Toolchain version
shows1.49.0
$ rustup install stable && rustup default stable
?For everyone that have installed rust via home-brew and were ‘mislead’ by jetbrains tutorial: Try standard brew path:
/opt/homebrew/bin
@ortem Is there any progress on this? Can I help you with trying out something?
I just found out, while exploring a different error, that it works out fine if I run the IDE from my bash session…
That said, I solved it by editing my
~/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/212.5284.44/bin/pycharm.sh
file:#!/usr/bin/env bash
(needed forsource
to work)source /opt/rust/env.sh
before final run commandWhere this is the content of
/opt/rust/env.sh
:This is not a permanent solution though obviously since IDE update will break it…
Similar issue with recognising Rust toolchain : https://youtrack.jetbrains.com/issue/CPP-21793
OS: OS X Rust installed with
brew
Hi @himhaidar ! Thanks for bringing our attention to this issue. It’s possible that in one of the future updates, we’ll add such functionality. In that case, we’ll reply with information to this ticket. Please stay subscribed to be informed.