Frage

I have a Rails app that I am hosting on Heroku, and hosting images on a Amazon S3. I am trying to add my Amazon credentials to my app using:

heroku config:add aws_access_key:<your access key> aws_secret_key:<your secret key>

I keep getting the error:

zsh: parse error near `\n'

I have no idea what the problem is.

War es hilfreich?

Lösung

Most likely your keys contain some characters that have special meaning to zsh.

Use single quotes (') around your keys:

heroku config:add aws_access_key='<your access key>' aws_secret_key='<your secret key>'

If there are any single quotes in your keys write '\'' instead. For example, instead of

aws_access_key=stevie's key

write

aws_access_key='stevie'\''s key'

Explanation: anything between a pair of single qoutes is taken exactly as it is written, there will be no parameter or command substitution or escape codes. As the second ' ends the quote any ' you want to write has to be quoted in anoter way outside of a pair of single quotes, either \' or "'".

Andere Tipps

I have the same error, and resolved it . because I type like this

$ heroku config:set AWS_SECRET_KEY=<A2D3F4H5A6D7HJ8KHF9>

then got the error. change like That:

$ heroku config:set AWS_SECRET_KEY=A2D3F4H5A6D7HJ8KHF9

success

You probably have some "special" characters in your Amazon access key or secret key which ZSH is interpreting. You usually need to "escape" these characters, but in this case you should be able to put the strings in quotes.

Try this instead (note the quotes around the values)

heroku config:add aws_access_key="<your access key>" aws_secret_key="<your secret key>"

I was facing the same error while trying to do a commit in GitHub. Turns out, <> are reserved, so of course I could NOT name anything within them. Posting this for SEO purposes for whoever faces the same issue in GitHub.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top