rust使用shuttle部署项目后端
shuttle v0.10使用说明
安装或更新 shuttle
如果系统磁盘剩余空间比较少,可以通过–target-dir来指定编译时产生的临时文件目录
|
|
登录shuttle
|
|
初始化
|
|
部署
|
|
本地运行
|
|
报错解决
error:
error: couldn’t read \?\x:...\target\debug\build\rustversion-…\out/version.expr: 文件名、目录名或卷标语法不正确。 (os error 123)
answer in discord:
You may need to do a cargo +1.65 build first, and then cargo +1.65 shuttle run for it to work on windows.
1.66 may work too. The + syntax is just to run a cargo command with a specific toolchain, if your default toolchain is that version you shouldn’t need it.
-
对项目使用指定rust版本,方式一(实际修改了.rustup/settings.toml)
- 在工程中执行: rustup override set 1.65
- 移除指定的版本: rustup override unset
-
方式二
- 工程中创建: rust-toolchain.toml
- 添加内容:
1 2 3
[toolchain] channel = "1.65" # channel = "nightly"
|
|
指定项目名
创建Shuttle.toml
在里面添加:
name = “your-project-name
- 原文作者:懒癌的日常生活
- 原文链接:https://lazy.icu/2023/02/16/rust-shuttle/
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. 进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。