openedu101 / rust-bootcamp-2024

Apache License 2.0
35 stars 13 forks source link

Fix lỗi khi chạy chương trình #3

Open TRANQUOCTUAN-TQT opened 8 months ago

TRANQUOCTUAN-TQT commented 8 months ago
Screenshot 2024-01-31 003839

em run bị lỗi này thì fix như nào ạ

vonhatcuong commented 8 months ago
  1. Run Cargo as administrator: This will give Cargo the permissions it needs to create the target directory. To do this, right-click on the Cargo executable and select "Run as administrator".

  2. Change the permissions of the directory: You can change the permissions of the directory so that you have write access. To do this, right-click on the directory and select "Properties". Then, go to the "Security" tab and click on the "Edit" button. In the "Group or user names" list, select your user account and make sure that the "Write" checkbox is checked. Click on the "Apply" button and then the "OK" button.

zrus commented 8 months ago

Bạn có thể run powershell dưới quyền admin để ko bị nữa nhé. Hoặc đặt project ở thư mục khác, ổ D chẳng hạn.

nthdat09 commented 8 months ago

Lỗi ở đây là bạn chưa cấp quyền Write cho thư mục nhé. Bạn có thể tham khảo cách sửa lỗi ở đây: https://blogchiasekienthuc.com/thu-thuat-may-tinh/phan-quyen-file-va-folder-trong-windows.html

CocDap commented 8 months ago

Bạn có thể run powershell dưới quyền admin để ko bị nữa nhé. Hoặc đặt project ở thư mục khác, ổ D chẳng hạn.

Hình như thư mục đó ko cho Quyền Write, mình nghĩ ổ đĩa D cũng dc ấy

divu12102004 commented 8 months ago

dạ cho em hỏi là là em đã cài rustc và cargo ròi khi em tọa file thì tạo ra được nhưng mà lúc cargo run cargo build nó hiện lỗi bên dưới

thinh@DESKTOP-NIHNLB6:~$ rustc --version cargo --version rustc 1.75.0 (82e1608df 2023-12-21) cargo 1.75.0 (1d8b05cdd 2023-11-20) thinh@DESKTOP-NIHNLB6:~$ cargo new capcap Created binary (application) capcap package thinh@DESKTOP-NIHNLB6:~$ cargo build error: could not find Cargo.toml in /home/thinh or any parent directory

CocDap commented 8 months ago

dạ cho em hỏi là là em đã cài rustc và cargo ròi khi em tọa file thì tạo ra được nhưng mà lúc cargo run cargo build nó hiện lỗi bên dưới

thinh@DESKTOP-NIHNLB6:~$ rustc --version cargo --version rustc 1.75.0 (82e1608df 2023-12-21) cargo 1.75.0 (1d8b05cdd 2023-11-20) thinh@DESKTOP-NIHNLB6:~$ cargo new capcap Created binary (application) capcap package thinh@DESKTOP-NIHNLB6:~$ cargo build error: could not find Cargo.toml in /home/thinh or any parent directory

Bạn phải cd capcap nhé, ý là trỏ tới thư mục project Rust

TRANQUOCTUAN-TQT commented 8 months ago

Bạn có thể run powershell dưới quyền admin để ko bị nữa nhé. Hoặc đặt project ở thư mục khác, ổ D chẳng hạn.

mình đã run dưới quyền admin rồi nhưng vẫn không bị chạy được á bạn

CocDap commented 8 months ago

Bạn có thể run powershell dưới quyền admin để ko bị nữa nhé. Hoặc đặt project ở thư mục khác, ổ D chẳng hạn.

mình đã run dưới quyền admin rồi nhưng vẫn không bị chạy được á bạn

Bạn thử qua ổ D chưa bạn

TRANQUOCTUAN-TQT commented 8 months ago
Screenshot 2024-02-01 203510

mình chuyển qua ở D rồi mà bị lỗi này

CocDap commented 8 months ago
Screenshot 2024-02-01 203510

mình chuyển qua ở D rồi mà bị lỗi này

Bạn thử chạy câu lệnh này nhé rustup target add x86_64-pc-windows-gnu

TRANQUOCTUAN-TQT commented 8 months ago
Screenshot 2024-02-01 203510

mình chuyển qua ở D rồi mà bị lỗi này

Bạn thử chạy câu lệnh này nhé rustup target add x86_64-pc-windows-gnu

Screenshot 2024-02-02 004240

mình làm theo rồi mà vẫn không được

CocDap commented 8 months ago

Bạn thử chạy cái này nhé: rustup toolchain install stable-x86_64-pc-windows-gnu

sau đó rustup default stable-x86_64-pc-windows-gnu

CocDap commented 8 months ago

@TRANQUOCTUAN-TQT ổn ko bạn?

TRANQUOCTUAN-TQT commented 8 months ago

@TRANQUOCTUAN-TQT ổn ko bạn?

Screenshot 2024-02-02 214701

mình làm được rồi mình cảm ơn