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

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

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

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

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

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

这解决了我的问题。

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

 Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }