jruby dotenv-rails 找不到代码转换器(UTF-8 到 UTF-8)

jruby dotenv-rails code converter not found (UTF-8 to UTF-8)

当我在 jruby 中安装 dotenv-rails 我的应用程序时(我使用 windows)我无法启动 Puma 服务器,因为我有这个错误:

web.1  | Encoding::ConverterNotFoundError: code converter not found (UTF-8 to UTF-8)
web.1  | 1.0/lib/dotenv.rb:14
web.1  | ivesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:36
web.1  |         require at org/jruby/RubyKernel.java:940
web.1  | /gems/shared/gems/puma-2.16.0-java/lib/puma/runner.rb:114

我不知道如何才能继续我的应用程序。

有人可以帮我吗?也许我可以使用另一个 gem 来制作同样的东西,但我需要一个教程来制作它。

非常感谢你帮助我。

这是 jRuby 而非 dotenv 的已知问题。

参考见 https://github.com/bkeepers/dotenv/issues/233https://github.com/jruby/jruby/issues/3647

它似乎已修复,应该包含在 jRuby 9.1.0.0 中

如果您将 dotenv 更改为依赖 2.0.2,那么您应该可以开始了。

gem "dotenv", "2.0.2"