Stuart Nelson
Stuart Nelson

Reputation: 4202

Permission denied for "heroku create" command

Previously, when I pushed my first app to heroku it did it with no problems - I typed "heroku create" and it all worked out fine. Now however I'm getting the following error message:

/Users/stuartnelson3/.heroku/client/vendor/gems/netrc-0.7.1/lib/netrc.rb:20:in `readlines': Permission denied - /Users/stuartnelson3/.netrc (Errno::EACCES)
from /Users/stuartnelson3/.heroku/client/vendor/gems/netrc-0.7.1/lib/netrc.rb:20:in `read'
from /Users/stuartnelson3/.heroku/client/lib/heroku/auth.rb:92:in `netrc'
from /Users/stuartnelson3/.heroku/client/lib/heroku/auth.rb:116:in `read_credentials'
from /Users/stuartnelson3/.heroku/client/lib/heroku/auth.rb:59:in `get_credentials'
from /Users/stuartnelson3/.heroku/client/lib/heroku/auth.rb:47:in `user'
from /Users/stuartnelson3/.heroku/client/lib/heroku/auth.rb:14:in `client'
from /Users/stuartnelson3/.heroku/client/lib/heroku/command/base.rb:38:in `heroku'
from /Users/stuartnelson3/.heroku/client/lib/heroku/command/apps.rb:108:in `create'
from /Users/stuartnelson3/.heroku/client/lib/heroku/command.rb:148:in `send'
from /Users/stuartnelson3/.heroku/client/lib/heroku/command.rb:148:in `run'
from /Users/stuartnelson3/.heroku/client/lib/heroku/cli.rb:9:in `start'
from /usr/bin/heroku:28

If I do "sudo heroku create" it works, but that's a pain to have to do that over and over, and I didn't have to originally. Can anyone help me with what's going on? I've been looking around but can't seem to find my netrc issue. I have no problems with git.

Upvotes: 1

Views: 1144

Answers (1)

forker
forker

Reputation: 2679

The error basically means that permission was denied on accessing the file itself or one of the directories it's located in. Most probably it's the file itself, so the following should help:

sudo chown stuartnelson3 /Users/stuartnelson3/.netrc
chmod 600 /Users/stuartnelson3/.netrc

Upvotes: 2

Related Questions