`fetch': key not found: “S3_BUCKET_NAME” (KeyError) with paperclip/aws s3/rails

六月ゝ 毕业季﹏ 提交于 2019-12-04 15:40:22

'fetch': key not found: "S3_BUCKET_NAME" means that the environment variables S3_BUCKET_NAME does not have a value.

In your case you are using Heroku. Follow the instructions in the link below.

For Heroku: https://devcenter.heroku.com/articles/config-vars.

If you are using ENV['variables'] you need to have them set in every environment. test, production and development. If you are developing on a PC, MAC, or Linux you need to make sure the environment variables are set.

For linux: https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps

For OSX: I do it the same was as linux, I just set them in my ~/.zshrc by adding a line like this. If you aren't using zshell then add a line to your ~/.bashrc or ~/.bash_profile.

export ENV_VARIABLE_NAME="value"

For Windows: I don't know how, but I am sure google does.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!