2016-06-26 5 views
4

최근에 녹 음 언어를 this site (Linux 64 비트)에서 다운로드하여 압축을 풉니 다. 녹 생성기가 'std'에 대한 크레이트를 찾을 수 없습니다

난 후 다운로드 install.sh에 주어진 스크립트를 사용하여 녹 설치 :

[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 위와 같은 결과로 실패했습니다. 따라서 특정 패키지에만 국한되지 않습니다.

심지어 간단한 프로그램 퍼팅 : 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이라는 디렉토리가 있습니다.이 디렉토리는 std 크레이트입니다. 표준 상자를 찾으려고 할 때이 디렉토리를 찾으려면 rustc에게 어떻게 지시해야합니까?

+0

가 컴파일 할 수 녹 코드? 예를 들어,'cargo install cargo-edit'를 시도해보십시오. Racer가 std의 소스 코드를 필요로하지만 오류 메시지는 * 컴파일러가 std * 바이너리 *를 찾을 수 없기 때문에 Racer 컴파일러가 될 수 없습니다. – delnan

+1

@delnan : 분명히 "안녕하세요, 세상!" 컴파일되지 않기 때문에, 여기서 문제는'stc' 상자가 어디에 있는지를 알지 못하는'rustc'이라는 것에 동의하는 경향이 있습니다. –

+0

[rustup] (https://www.rustup.rs/)을 사용해 볼 수 있습니다. –

답변

1

다음은 가장 간단한 컴파일 작업입니다. 당신이에 tar 파일의 압축을 푼 가정 는 다음

arch=x86_64-unknown-linux-gnu 
dl=$HOME/rust-1.10.0-$arch 
$dl/rustc/bin/rustc -L $dl/rustc/lib \ 
    -L $dl/rust-std-$arch/lib/rustlib/$arch/lib \ 
    hello.rs 

을 실행하지만 더 좋은 방법은 크리스 모건 제안으로 rustup 실행하는 것입니다 확신

$HOME/rust-1.10.0-x86_64-unknown-linux-gnu 

을 말한다.

Coupla 더 많은 포인트

  1. 당신은 루트로 코드를 컴파일하지 않아야합니다.
  2. bash -l을 다시 로그인하거나 실행시켜야 만 환경을 설정할 수 있습니다. 레이서가 아닌 다른

(여기 연구원 녹 newb)