2
almanex@LAPTOP-GHRH09TN:~$ cd /mnt/x/
almanex@LAPTOP-GHRH09TN:/mnt/x$ mkdir -p coding
almanex@LAPTOP-GHRH09TN:/mnt/x$ cd coding
almanex@LAPTOP-GHRH09TN:/mnt/x/coding$ rails new webapp
      create
      create  README.md
      create  Rakefile
      create  .ruby-version
      create  config.ru
      create  .gitignore
      create  Gemfile
         run  git init from "."
error: chmod on /mnt/x/coding/webapp/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'

Hello, I'm trying to create an app on rails but there is an issue with chmod, I've searched the net but there is only one solution that I found and already tried (as you can see): creating the directory with -p option. This did not help. Do you have some ideas what should I do?

jelemican
  • 21
  • 1
  • 2
  • Welcome to SO. `-p` has nothing to do with file permissions. It will only make parent dir if it doesn't exist. Try executing the command with `sudo` – Digvijay S Apr 26 '20 at 08:31
  • 1
    Does this answer your question? [Git init: fatal: could not set 'core.filemode' to 'false'](https://stackoverflow.com/questions/50108363/git-init-fatal-could-not-set-core-filemode-to-false) – Digvijay S Apr 26 '20 at 08:32

1 Answers1

1

I had this same issue but with git clone, adding a sudo before the command fixed it for me.

ie sudo rails new webapp

NSA_Intern
  • 64
  • 2