Gemfile.lock write error, permissions? Gemfile.lock write error, permissions? ruby ruby

Gemfile.lock write error, permissions?


Your app root directory (whose permissions govern file creation) and files are all owned by root instead of your user (possibly because you did sudo rails new—don’t use sudo for that). You can change the permissions by doing:

sudo chown -R $(whoami):$(whoami) myappfolder

Where “myappfolder” is your Rails app’s root directory.

By the way, a good tip with regard to sudo is to always try the command without it first, then, if there’s a permissions error when it runs, you may need sudo. Don’t default to using sudo.


Sometimes the above answer:

sudo chown -R $(whoami):$(whoami) myappfolder

will give you the error:

chown: ifeegoo: illegal group name

You can also try this kind of command:

sudo chown -R ifeegoo: /Users/ifeegoo/workspace/rails/Test


I had the same issue, that's how i fixed mine.

If you are using ZSH then goto

profile -> command

and check "Run command as a login shell" and close the terminal.Fire up your terminal and initiate bundle install command.