雾化 OpenSSL 错误

Fog OpenSSL error

我正在尝试使用雾将文件上传到 S3。我一直在关注这里的雾教程:http://fog.io/storage/ 但我收到了一个错误。有什么明显的我想念的吗?我的连接对象有效,我可以浏览目录和现有文件。我可以创建一个新的文本文件。但是当我尝试上传 mp3 时出现 ssh 错误。我很乐意提供有关我的设置的更多信息,我只是不知道什么是相关的。

当我运行这个ruby代码时:

connection.directories[1].files.create(key: 'test.mp3', body: File.open("/path/to/test.mp3"), public: true)

我收到这个错误:

Excon::Errors::SocketError: uninitialized constant OpenSSL::OPENSSL_LIBRARY_VERSION (NameError)
from /Users/me/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/excon-0.45.2/lib/excon/socket.rb:245:in `rescue in block in write_nonblock'

我正在使用 ruby 2.0.0-p451

我在 OSX 10.9.5

这是我的 gemfile 中所有模糊的东西:

fog (1.28.0)
      fog-atmos
      fog-aws (~> 0.0)
      fog-brightbox (~> 0.4)
      fog-core (~> 1.27, >= 1.27.3)
      fog-ecloud
      fog-json
      fog-profitbricks
      fog-radosgw (>= 0.0.2)
      fog-riakcs
      fog-sakuracloud (>= 0.0.4)
      fog-serverlove
      fog-softlayer
      fog-storm_on_demand
      fog-terremark
      fog-vmfusion
      fog-voxel
      fog-xml (~> 0.1.1)
      ipaddress (~> 0.5)
      nokogiri (~> 1.5, >= 1.5.11)
    fog-atmos (0.1.0)
      fog-core
      fog-xml
    fog-aws (0.1.1)
      fog-core (~> 1.27)
      fog-json (~> 1.0)
      fog-xml (~> 0.1)
      ipaddress (~> 0.8)
    fog-brightbox (0.7.1)
      fog-core (~> 1.22)
      fog-json
      inflecto (~> 0.0.2)
    fog-core (1.29.0)
      builder
      excon (~> 0.38)
      formatador (~> 0.2)
      mime-types
      net-scp (~> 1.1)
      net-ssh (>= 2.1.3)
    fog-ecloud (0.0.2)
      fog-core
      fog-xml
    fog-json (1.0.0)
      multi_json (~> 1.0)
    fog-profitbricks (0.0.1)
      fog-core
      fog-xml
      nokogiri
    fog-radosgw (0.0.3)
      fog-core (>= 1.21.0)
      fog-json
      fog-xml (>= 0.0.1)
    fog-riakcs (0.1.0)
      fog-core
      fog-json
      fog-xml
    fog-sakuracloud (1.0.0)
      fog-core
      fog-json
    fog-serverlove (0.1.1)
      fog-core
      fog-json
    fog-softlayer (0.4.1)
      fog-core
      fog-json
    fog-storm_on_demand (0.1.0)
      fog-core
      fog-json
    fog-terremark (0.0.4)
      fog-core
      fog-xml
    fog-vmfusion (0.0.1)
      fission
      fog-core
    fog-voxel (0.0.2)
      fog-core
      fog-xml
    fog-xml (0.1.1)
      fog-core
      nokogiri (~> 1.5, >= 1.5.11)

openssl 版本:

openssl
OpenSSL> version
OpenSSL 0.9.8zd 8 Jan 2015

得知您遇到此问题,我们深感抱歉。我们在 excon 中添加了 openssl 版本的检查,因为 openssl 有一个带有错误的版本(因此我们将其设置为在您遇到该错误进行更新时提供更好的 warning/instruction)。我们没有意识到在某些情况下可能未定义此常量。我已经更新了代码以在常量未定义时跳过检查并发布了 excon 0.45.3,如果您更新到它应该可以避免这个问题。

综上所述,我认为还值得注意的是,您拥有的 openssl 版本已经相当过时(尽管由于向后移植的安全修复,它可能不是很明显)。升级到 1.0.1 甚至 1.0.2 系列中的某些东西可能是个好主意(可能使用包管理器,我为此使用自制软件)。这也可能会解决您的问题,但不管怎样可能是个好主意。

希望对您有所帮助!