3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

cargo install cargo-generateのエラーで嵌まった話

Posted at

cargo install cargo-generateを実行すると、rhaiのバージョンが合わないと言われた

~$ cargo install cargo-generate
    Updating crates.io index
  Installing cargo-generate v0.16.0
error: failed to compile `cargo-generate v0.16.0`, intermediate artifacts can be found at `/tmp/cargo-installpQrOU1`

Caused by:
  failed to select a version for the requirement `rhai = "^1.8"`
  candidate versions found which didn't match: 1.7.0, 1.6.1, 1.6.0, ...
  location searched: crates.io index
  required by package `cargo-generate v0.16.0`

cargo-generateの最新バージョンが0.16で、使用しているrhaiのバージョンは1.8
しかし、使用できるrhaiのバージョンは最高でも1.7でした。

しかし、cargo searchで調べると1.9.1が最新

~$ cargo search rhai
rhai = "1.9.1"                   # Embedded scripting for Rust
rhai-doc = "0.2.2"               # Documentation tool for Rhai - an embedded scripting language and engine for Rust
rhai-rand = "0.1.4"              # Random number package for Rhai
rhai-sci = "0.1.7"               # Scientific computing in the Rhai scripting language
bevy_rhai = "0.3.0"              # An easy way to integrate Rhai with Bevy.
tide-rhai = "0.0.2"              # A scritping component for tide.
quad-compat-rhai = "1.4.0"       # Embedded scripting for Rust
rhai_codegen = "1.4.2"           # Procedural macros support package for Rhai, a scripting language and engine for Rust
bevy_api_gen = "0.1.1"           # Derive macros for bevy_mod_scripting
bevy_event_priority = "0.1.1"    # Bevy plugin providing priority based event handling
... and 26 crates more (use --limit N to see more)

create.ioに問い合わせた結果、1.9.1が最新だという。
なぜそれを使用しないのか?

rustのバージョンが古かった

~/cargo-generate$ cargo --version
cargo 1.59.0 (49d8809dc 2022-02-10)

ググったら、執筆時点での最新バージョンは1.63だった。

rustをアップデートする

~$ rustup update
・・・
  stable-x86_64-unknown-linux-gnu updated - rustc 1.63.0 (4b91a6ea7 2022-08-08) (from rustc 1.59.0 (9d1b2106e 2022-02-23))

この状態で再びcargo-generateをインストール

~$ cargo install cargo-generate
・・・
   Installed package `cargo-generate v0.16.0` (executable `cargo-generate`)

ここまで到達するのに1時間半かかりました。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?