最近、Rust言語をthis site(Linux 64ビット)からダウンロードして解凍しました。Rustコンパイラが 'std'のクレートを見つけることができません
[email protected]:~# /root/rust-1.9.0-x86_64-unknown-linux-gnu/install.sh
install: uninstalling component 'rustc'
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'rust-std-x86_64-unknown-linux-gnu'
install: installing component 'rust-docs'
install: installing component 'cargo'
Rust is ready to roll.
私は貨物とクレートをインストールしようとしていますが、私はこのエラーに実行し続ける:
[email protected]:~# cargo install racer
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling winapi v0.2.7
Compiling bitflags v0.5.0
error: can't find crate for `std` [E0463]
error: aborting due to previous error
Build failed, waiting for other jobs to finish...
error: can't find crate for `std` [E0463]
error: aborting due to previous error
error: failed to compile `racer v1.2.10`, intermediate artifacts can be found at `/root/target-install`
cargo install cargo-edit
私は、ダウンロードinstall.sh
で指定したスクリプトを使用して錆をインストール
上記と同じ結果で失敗したので、特定のパッケージに限定されるものではありません。でも、簡単なプログラム入れ
:hello.rs
とrustc hello.rs
コンパイルされませんを実行しているという名前のファイルに
fn main() {
println!("Hello, world!");
}
を。同じエラーが発生します:error: can't find crate for 'std' [E0463]
。
このダウンロードには、rust-std-x86_64-unknown-linux-gnu
という名前のディレクトリがあります。これは、標準化された箱です。どのように私は標準ディレクトリを見つけるときにこのディレクトリを見つけるためにrustcに指示するのですか?
あなたはレーサー以外の錆のコードをコンパイルすることはできますか?たとえば、 'cargo install cargo-edit'を試してみてください。 Racerはstdのソースコードを必要としますが、コンパイラはstd *バイナリ*を見つけることができないので、コンパイラのRacerをコンパイルすることはできません。 – delnan
@delnan:明らかに「こんにちは、世界!コンパイルされないので、ここでの問題は 'stc'がどこにあるのか分からない' rustc'であることに同意する傾向があります。 –
あなたは[rustup](https://www.rustup.rs/)を試してみることができます。 –