Skip to content
Advertisement

How to solve librustdoc.so missing when using rustbook tool?

I’ve used

cargo install --git https://github.com/steveklabnik/rustbook.git

to install rustbook successfully, but when I run rustbook I get an error:

rustbook: error while loading shared libraries: librustdoc-c0dcaea09a16c7ec.so: cannot open shared object file: No such file or directory

But I can find out this .so file.

./.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustdoc-c0dcaea09a16c7ec.so
./.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustdoc-c0dcaea09a16c7ec.so

How can I let rustbook know the path to librustdoc-c0dcaea09a16c7ec.so?

  • rustc 1.16.0-nightly (4ecc85beb 2016-12-28)
  • rustdoc 1.16.0-nightly (4ecc85beb 2016-12-28)

rustup show:

Default host: x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
rustc 1.16.0-nightly (4ecc85beb 2016-12-28)

Advertisement

Answer

This appears to be a known issue with rustup (#350, #765), specifically around cargo-installed binaries that were compiled against the nightly toolchain. If your application requires nightly to even compile, there’s not much you can do other than rustup run nightly myprogram. This will start the program with the appropriate environment.

If the application doesn’t require nightly Rust, then install it using the stable toolchain.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement