1

I'm trying to build Tic Tac Toe via Ruby, and I want Ruby file to be executable so everyone can run it.

The problem is: I'm using Windows 10, and I'm not able to make the file executable:

  • I've tried to make it executable using Right Click and via the Security tab
  • I've also tried following this guide but didn't work.
  • When I'm putting #!/usr/bin/env ruby at the top of the file, Rubocop is throwing error telling me that this file is not executable

I've searched everywhere, but couldn't find a solution. I would be thankful if you can help me solve this problem.

1 Answers1

1

I have figured out how to solve this problem. and I'm happy to share the experience with you guys.

  • First of all, you should install WSL into your machine.
  • Then you should follow this guide in order to change the mode of your file (to be executable)
  • You'll probably after that run into another problem, which is the Carriage Return Character. In order to solve this problem, you either install a virtual Linux system into your computer, or you can use GitPod instead of your editor, and that's what I recommend. You can add your project using this link gitpod.io/github.com/[user_name]/[repo_name]/tree/[branch_name]
  • After that, you should delete your file and create a new one (to get rid of the carriage return character).

CONGRATULATIONS You've gotten rid of that problem. Now add, commit and push your changes to the repository.

It's a long journey, but it does what you need.

General Grievance
  • 4,555
  • 31
  • 31
  • 45