简体   繁体   English

雾和AWS警告:无法加载'unf'宝石

[英]Warning with fog and AWS: unable to load the 'unf' gem

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:migrate等)都会发出警告:

[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: 我确定我没有更改我的application.rb文件中的AWS字符串中的任何内容:

    # 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. 我的gemfile中没有这个“unf”gem。 Should I add it? 我应该加吗?

Yes, this just happened a few days ago. 是的,这只是几天前发生的。 You can see from the pull request and commit that the unf dependency is optional. 您可以从pull请求中看到并确认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. 确实删除了警告没有任何问题。

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. 如果您没有名称中没有ASCII字符的任何S3存储桶/对象,我认为您可以放心地忽略该警告。 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. 我们可能会做些什么来减少它的噪音,但是现在你可以忽略或添加不安静它,正如@trh指出的那样。

I apparently had fog-1.18.0 installed when I saw this error. 当我看到这个错误时,我显然安装了雾1.18.0。 (Restarting an aws vagrant project I installed a while ago) My naive attempt at a fix was to start with an upgrade (重新启动我刚刚安装的aws vagrant项目)我对修复的天真尝试是从升级开始

  gem install fog

which upgraded something to fog-1.21.0. 将某些东西升级为雾1.21.0。 As it warned, "This could take a while..." ... and that did not help. 正如它警告的那样,“这可能需要一段时间......”......这并没有帮助。

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.rb,但是当我看时它已经存在了。

  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. 我升级了流浪者本身(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. 我不确定我之前的任何笨拙尝试是否也是必要的,所以无论如何我都在这里注意到它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM