Skip to content

Problem running 'cargo run' on code-runner #500

@hanzckernel

Description

@hanzckernel

I have been trying several ways in configuring code-runner to run Rust file, none of which works for me:
System-info

OS: macOS Mojave 10.14.5

Attempt
Follow the recipe of #410 I have tried to add these in my settings.json file:

"code-runner.executorMap": {
    "rust": "cargo run # $fileName",

 // or this

    "rust": "cargo run $workspaceRoot",

  // or this 

    "rust": "cargo run $fileName",
  },

// or I have also configured like this:

  "code-runner.customCommand": "cargo run",

All produce the same error:
`
[Running] cargo run
/bin/sh: cargo: command not found

[Done] exited with code=127 in 0.024 seconds
`
Meanwhile running on terminal works fine.

Here are some possible relevant configs:

"code-runner.showExecutionMessage": true,
  "code-runner.clearPreviousOutput": true,
  "code-runner.fileDirectoryAsCwd": true,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions