Rails 5:不推荐使用参数“Gem.paths =`”中的数组值

问题描述 投票:28回答:2

基于actioncable-examples构建websockets app。启动服务器,运行rake等时,我不断收到消息:

Array values in the parameter to `Gem.paths=` are deprecated.

这里没有看到解决方案,但确实找到了解决方案。我想在这里发布问题和答案,以便它可用。

ruby-on-rails ruby-on-rails-5
2个回答
74
投票

我在RubyGems问题#1551 here中找到了答案。 binstubs是bin文件夹中的文件,需要更新。最好的方法是:

bundle update spring
bundle exec spring binstub --remove --all
bundle exec spring binstub --all

这解决了我的问题。


-1
投票

我在rails 4.2.7应用程序中也面临同样的错误,我修复了更新bin/spring文件行11号的错误

Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
© www.soinside.com 2019 - 2024. All rights reserved.