Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Joshua Wolfe
Joshua Wolfe
1,897 Points

Setting up Rust, ubuntu

I realize that is more a of a title. But it explains the problem and asks the question, more or less. I get this error message after ive run a basic hello world program in rust. I dont know what it means. Im runing latest version of linux buntu and working in sublime text 3.

Open a Rust file to determine which package to use, or add a folder with a Cargo.toml file to your Sublime project. error: Error: Cannot determine Rust package to use.

1 Answer

Eric M
Eric M
11,546 Points

Hi Joshua,

Some basic troubleshooting questions from the command line:

  • Have you installed rustc and cargo via rustup? Can you do a rustup update?

  • Are you able to create a new program via cargo new your_program_name then move into that program folder and run cargo run?

The error seems like a Sublime text error, and I haven't used Sublime with Rust sorry. I highly recommend Intellij IDEA with the Rust plugin. It's Rust language support is very good (certainly better than VS Code, can't speak for Sublime).

When you create a program with cargo it should have cargo.toml and associated folders. You may simply need to add those to Sublime as the error message suggests.

Can I also recommend that you'll have better luck with the (wonderful) Rust community directly on their forums or reddit than on Teamtreehouse, where there is no Rust content :p

Best of luck and I hope you enjoy Rust as much as I do!

Cheers,

Eric