Every action in a rails console (rails server, rails console, db:migrate, etc.) raises a warning since my last bundle update:
rails控制台中的每一个动作(rails服务器、rails控制台、db: migration等)都在我最近一次包更新后发出警告:
[fog][WARNING] Unable to load the 'unf' gem. Your AWS strings may not be properly encoded.
I'm sure I didn't change anything in the AWS strings which are in my application.rb file:
我确信我的应用程序中的AWS字符串没有任何改变。rb文件:
# Amazon S3 credentials
ENV["AWS_ACCESS_KEY_ID"] = "AWS_ACCESS_KEY_ID"
ENV["AWS_SECRET_ACCESS_KEY"] = "AWS_SECRET_ACCESS_KEY"
ENV["AWS_S3_BUCKET"] = "my-bucket"
I don't have this "unf" gem in my gemfile. Should I add it?
我的宝石文件里没有unf的宝石。我应该把它吗?
3 个解决方案
#1
74
Yes, this just happened a few days ago. You can see from the pull request and commit that the unf dependency is optional.
是的,这是几天前发生的。您可以从拉请求和提交中看到unf依赖项是可选的。
https://github.com/fog/fog/pull/2320/commits
https://github.com/fog/fog/pull/2320/commits
When I updated my current bundle with fog I received the same warnings, and adding
当我用大雾更新当前的包时,我收到了相同的警告,并添加了。
gem 'unf'
does indeed remove the warning without any issues.
确实删除了警告,没有任何问题。
#2
13
If you do not have any S3 buckets/objects that would have not ASCII characters in the names, I think you can safely disregard the warning. We may do something to make it less noisy also, but for now you can ignore or add unf to quiet it down, as @trh pointed out.
如果您没有任何S3 bucket /对象的名称中没有ASCII字符,我认为您可以安全地忽略这个警告。我们可以做一些事情来减少它的噪音,但是现在你可以忽略或添加unf来使它安静下来,@trh指出。
#3
7
I apparently had fog-1.18.0 installed when I saw this error. (Restarting an aws vagrant project I installed a while ago) My naive attempt at a fix was to start with an upgrade
当我看到这个错误时,我显然已经安装了fog-1.18.0。(重新启动我之前安装的aws漫游项目)我对修复的天真尝试是从升级开始。
gem install fog
which upgraded something to fog-1.21.0. As it warned, "This could take a while..." ... and that did not help.
它升级为fog1。21.0。正如它所警告的,“这可能需要一段时间……”…但这并没有帮助。
Exactly WHERE to add "gem 'unf'" wasn't clear from the solution voted up here, it seemed to be lib/fog/aws.rb but that was already there when I looked.
在这里投票的解决方案中,不清楚“gem unf”在哪里添加,似乎是lib/fog/aws。但是当我看的时候,它已经在那里了。
gem install unf
appeared to add it somewhere, but the problem did not go away.
似乎在某处添加了它,但问题并没有消失。
I upgraded vagrant itself (1.4.3 to 1.5.1) and THAT didn't fix it.
我升级了vagrant(1.4.3到1.5.1),这并没有解决问题。
Eventually, the fix was
最终,修复
vagrant plugin install unf
as I found in a thread at https://github.com/mitchellh/vagrant/issues/2507
正如我在https://github.com/mitchellh/vagrant/issues/2507中发现的那样
I'm not sure if any of my previous fumbling attempts were also necessary, so I noted them here anyway.
我不确定是否我之前的任何摸索尝试都是必要的,所以我在这里指出了它们。