NotImplementedError:pbkdf2_hmac()函数在此机器上未实现

时间:2015-06-17 15:22:29

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 heroku

我正在努力将ruby和rails版本升级到我的应用程序。我使用rails 3.2和ruby' 1.9.3',对于这个版本Gibberish在heroku上工作正常。在我升级了rails 4.2和ruby 2.2.0后,Gibberish无法正常工作并且在heroku上出错。

所以我在heroku中创建了一个新的应用程序并配置了4.2和2.2.0,然后进行了测试。有Gibberish工作正常没有任何错误。但我不想配置新的应用程序。因为我在现有的应用程序上配置得很好。我错过了什么意思吗?跟踪......

irb(main):002:0> Gibberish::AES.new("12345").encrypt("data")
NotImplementedError: pbkdf2_hmac() function is unimplemented on this machine
from /app/vendor/bundle/ruby/2.2.0/gems/gibberish-2.0.0/lib/gibberish/aes.rb:140:in `pbkdf2_hmac'
from /app/vendor/bundle/ruby/2.2.0/gems/gibberish-2.0.0/lib/gibberish/aes.rb:140:in `encrypt'
from /app/vendor/bundle/ruby/2.2.0/gems/gibberish-2.0.0/lib/gibberish/aes.rb:100:in `encrypt'
from (irb):2
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/console.rb:110:in `start'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in `start'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in `console'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:10:in `require'
from bin/rails:10:in `<main>'

注意:我正在Gibberish

上运行最新版本

提前致谢!

1 个答案:

答案 0 :(得分:0)

Prior to Gibberish 2.0, the default encryption mode was CBC. But now not!.

我在验证加密格式后提出了解决方案。现在,Gibberish正在基于OpenSSL版本工作。 Gibberish 2将在OpenSSl上运行最新版本。如果您想使用旧版本的ssl,那么您必须CBC

Gibberish::AES::CBC.new("12345").encrypt("data")

Gibberish 1.4将生成

Gibberish::AES.new("p4ssw0rd").enc("Some top secret data")
#=> U2FsdGVkX187oKRbgDkUcMKaFfB5RsXQj/X4mc8X3lsUVgwb4+S55LQo6f6N\nIDMX

但现在CBC将生成此格式化输出。

我建议在heroku中更新openssl。