深入解析 Starknet 学习之 Dojo 安装问题及解决方案

深入解析Starknet学习之Dojo安装问题及解决方案引言在学习Starknet和Cairo生态系统的过程中,安装工具链是不可避免的一步。然而,安装过程中常常会遇到各种问题,尤其是在安装Dojo这类工具时。本篇文章将深入分析这些问题,并提供详细的解决方案,帮助你顺利完成D

深入解析 Starknet 学习之 Dojo 安装问题及解决方案

引言

在学习 Starknet 和 Cairo 生态系统的过程中,安装工具链是不可避免的一步。然而,安装过程中常常会遇到各种问题,尤其是在安装 Dojo 这类工具时。本篇文章将深入分析这些问题,并提供详细的解决方案,帮助你顺利完成 Dojo 的安装,让你能专注于开发与学习。

Install Dojo using dojoup

curl -L https://install.dojoengine.org | bash

安装失败

image-20240118182848831.png

实操

dojoup

═════════════════════════════════════════════════════════════════════════

                  ██████╗  ██████╗      ██╗ ██████╗
                  ██╔══██╗██╔═══██╗     ██║██╔═══██╗
                  ██║  ██║██║   ██║     ██║██║   ██║
                  ██║  ██║██║   ██║██   ██║██║   ██║
                  ██████╔╝╚██████╔╝╚█████╔╝╚██████╔╝
                  ╚═════╝  ╚═════╝  ╚════╝  ╚═════╝

              Repo : https://github.com/dojoengine/dojo
              Book : https://book.dojoengine.org/
              Chat : https://discord.gg/dojoengine
                     https://t.me/dojoengine

═════════════════════════════════════════════════════════════════════════

dojoup: installing dojo (version , tag )
https://github.com/dojoengine/dojo/releases/download//dojo__darwin_arm64.tar.gz
dojoup: downloading latest dojo
########################################################################################################################################################## 100.0%
tar: Error opening archive: Unrecognized archive format
dojoup: command failed: tar -xzC /Users/qiaopengjun/.dojo/bin
/Users/qiaopengjun/.dojo/bin/dojoup: line 251: /Users/qiaopengjun/.dojo/bin/katana: No such file or directory
dojoup: command failed: /Users/qiaopengjun/.dojo/bin/katana --version
dojoup: installed -
dojoup: warning:
There are multiple binaries with the name 'katana' present in your 'PATH'.
This may be the result of installing 'katana' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/Users/qiaopengjun/.dojo/bin'
in your 'PATH' to allow the newly installed version to take precedence!

/Users/qiaopengjun/.dojo/bin/dojoup: line 251: /Users/qiaopengjun/.dojo/bin/sozo: No such file or directory
dojoup: command failed: /Users/qiaopengjun/.dojo/bin/sozo --version
dojoup: installed -
dojoup: warning:
There are multiple binaries with the name 'sozo' present in your 'PATH'.
This may be the result of installing 'sozo' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/Users/qiaopengjun/.dojo/bin'
in your 'PATH' to allow the newly installed version to take precedence!

/Users/qiaopengjun/.dojo/bin/dojoup: line 251: /Users/qiaopengjun/.dojo/bin/torii: No such file or directory
dojoup: command failed: /Users/qiaopengjun/.dojo/bin/torii --version
dojoup: installed -
dojoup: warning:
There are multiple binaries with the name 'torii' present in your 'PATH'.
This may be the result of installing 'torii' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/Users/qiaopengjun/.dojo/bin'
in your 'PATH' to allow the newly installed version to take precedence!

/Users/qiaopengjun/.dojo/bin/dojoup: line 251: /Users/qiaopengjun/.dojo/bin/dojo-language-server: No such file or directory
dojoup: command failed: /Users/qiaopengjun/.dojo/bin/dojo-language-server --version
dojoup: installed -
dojoup: warning:
There are multiple binaries with the name 'dojo-language-server' present in your 'PATH'.
This may be the result of installing 'dojo-language-server' using another method,
like Cargo or other package managers.
You may need to run 'rm ' or move '/Users/qiaopengjun/.dojo/bin'
in your 'PATH' to allow the newly installed version to take precedence!

dojoup: done!

解决问题

第一步:

执行

cargo install --git https://github.com/dojoengine/dojo --force sozo katana torii

实操

cargo install --git https://github.com/dojoengine/dojo --force sozo katana torii

    Updating git repository `https://github.com/dojoengine/dojo`
remote: Enumerating objects: 18446, done.
remote: Counting objects: 100% (18434/18434), done.
remote: Compressing objects: 100% (7073/7073), done.
remote: Total 18446 (delta 11079), reused 17946 (delta 10903), pack-reused 12
接收对象中: 100% (18446/18446), 6.91 MiB | 5.75 MiB/s, 完成.
处理 delta 中: 100% (11079/11079), 完成.
来自 https://ghproxy.com/https://github.com/dojoengine/dojo
 * [新引用]            HEAD       -> origin/HEAD
 * [新标签]            nightly-02cdf334798e98651f3cd059b35bf069244136b4 -> nightly-02cdf334798e98651f3cd059b35bf069244136b4

......

   Compiling katana-rpc-types-builder v0.5.1-alpha.0 (/Users/qiaopengjun/.cargo/git/checkouts/dojo-10cac2e09298cf35/cd410f9/crates/katana/rpc/rpc-types-builder)
warning: `katana-primitives` (lib) generated 3 warnings (run `cargo fix --lib -p katana-primitives` to apply 3 suggestions)
   Compiling katana-rpc v0.5.1-alpha.0 (/Users/qiaopengjun/.cargo/git/checkouts/dojo-10cac2e09298cf35/cd410f9/crates/katana/rpc)
   Compiling katana v0.5.1-alpha.0 (/Users/qiaopengjun/.cargo/git/checkouts/dojo-10cac2e09298cf35/cd410f9/crates/katana)
    Finished release [optimized] target(s) in 6m 40s
  Installing /Users/qiaopengjun/.cargo/bin/katana
   Installed package `katana v0.5.1-alpha.0 (https://github.com/dojoengine/dojo#cd410f99)` (executable `katana`)
     Summary Successfully installed sozo, katana! Failed to install torii (see error(s) above).
error: some crates failed to install

第二步:

执行

dojoup

实操

dojoup

═════════════════════════════════════════════════════════════════════════

                  ██████╗  ██████╗      ██╗ ██████╗
                  ██╔══██╗██╔═══██╗     ██║██╔═══██╗
                  ██║  ██║██║   ██║     ██║██║   ██║
                  ██║  ██║██║   ██║██   ██║██║   ██║
                  ██████╔╝╚██████╔╝╚█████╔╝╚██████╔╝
                  ╚═════╝  ╚═════╝  ╚════╝  ╚═════╝

              Repo : https://github.com/dojoengine/dojo
              Book : https://book.dojoengine.org/
              Chat : https://discord.gg/dojoengine
                     https://t.me/dojoengine

═════════════════════════════════════════════════════════════════════════

dojoup: installing dojo (version v0.5.0, tag v0.5.0)
https://github.com/dojoengine/dojo/releases/download/v0.5.0/dojo_v0.5.0_darwin_arm64.tar.gz
dojoup: downloading latest dojo
########################################################################################################################################################## 100.0%
dojoup: installed - katana 0.5.0
dojoup: warning:
There are multiple binaries with the name 'katana' present in your 'PATH'.
This may be the result of installing 'katana' using another method,
like Cargo or other package managers.
You may need to run 'rm /Users/qiaopengjun/.cargo/bin/katana' or move '/Users/qiaopengjun/.dojo/bin'
in your 'PATH' to allow the newly installed version to take precedence!

dojoup: installed - sozo 0.5.0
dojoup: warning:
There are multiple binaries with the name 'sozo' present in your 'PATH'.
This may be the result of installing 'sozo' using another method,
like Cargo or other package managers.
You may need to run 'rm /Users/qiaopengjun/.cargo/bin/sozo' or move '/Users/qiaopengjun/.dojo/bin'
in your 'PATH' to allow the newly installed version to take precedence!

dojoup: installed - torii 0.5.0
dojoup: installed - dojo-language-server 0.5.0
dojoup: done!

成功解决!

sozo init

 ⛩️ ====== STARTING ====== ⛩️

Setting up project directory tree...
Cloning project template from https://github.com/dojoengine/dojo-starter...

🎉 Successfully created a new ⛩️ Dojo project!

====== SETUP COMPLETE! ======

To start using your new project, try running: `sozo build`

更多详情请查看

点赞 0
收藏 0
分享
本文参与登链社区写作激励计划 ,好文好收益,欢迎正在阅读的你也加入。

0 条评论

请先 登录 后评论
寻月隐君
寻月隐君
0x750E...B6f5
不要放弃,如果你喜欢这件事,就不要放弃。如果你不喜欢,那这也不好,因为一个人不应该做自己不喜欢的事。