user9175041
user9175041

Reputation: 29

How do I change the terminal command type in VSCode

Im running VSCode on Mac and I'm trying to write a Ruby script, however everytime I try to run the file I get this error:

/Ruby/test.rb: line 1: puts: command not found

I notice that the terminal is set up to use bash. I suspect that I need to somehow configure the terminal to recognize the script as Ruby, but I'm not sure how.

Upvotes: 0

Views: 115

Answers (1)

Aman Gupta
Aman Gupta

Reputation: 440

just add . to the start of the file but make sure you do the following before executing it

  1. start your program with #!/usr/bin/env ruby,
  2. make your file executable by running chmod +x your_program.rb
  3. and do ./your_program.rb some_param

Upvotes: 1

Related Questions