当前位置:  开发笔记 > 后端 > 正文

为什么我在运行rake cucumber时得到"警告:已初始化的常量JSON :: VERSION"?

如何解决《为什么我在运行rakecucumber时得到"警告:已初始化的常量JSON::VERSION"?》经验,为你挑选了1个好方法。

我刚刚用rvm为rails开发设置了一个Linux Mint盒子.我继续生成了一个Rails 5应用程序,设置了mysql连接,添加了cucumber-rails gem然后尝试运行:

rake cucumber

出于某种原因,我遇到了:

/usr/bin/ruby2.3 -S bundle exec cucumber --profile default
/usr/lib/ruby/vendor_ruby/json/version.rb:3: warning: already initialized constant JSON::VERSION
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/version.rb:3: warning: previous definition of VERSION was here
/usr/lib/ruby/vendor_ruby/json/version.rb:4: warning: already initialized constant JSON::VERSION_ARRAY
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/version.rb:4: warning: previous definition of VERSION_ARRAY was here
/usr/lib/ruby/vendor_ruby/json/version.rb:5: warning: already initialized constant JSON::VERSION_MAJOR
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/version.rb:5: warning: previous definition of VERSION_MAJOR was here
/usr/lib/ruby/vendor_ruby/json/version.rb:6: warning: already initialized constant JSON::VERSION_MINOR
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/version.rb:6: warning: previous definition of VERSION_MINOR was here
/usr/lib/ruby/vendor_ruby/json/version.rb:7: warning: already initialized constant JSON::VERSION_BUILD
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/version.rb:7: warning: previous definition of VERSION_BUILD was here
/usr/lib/ruby/vendor_ruby/json/common.rb:99: warning: already initialized constant JSON::NaN
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/common.rb:99: warning: previous definition of NaN was here
/usr/lib/ruby/vendor_ruby/json/common.rb:101: warning: already initialized constant JSON::Infinity
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/common.rb:101: warning: previous definition of Infinity was here
/usr/lib/ruby/vendor_ruby/json/common.rb:103: warning: already initialized constant JSON::MinusInfinity
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/common.rb:103: warning: previous definition of MinusInfinity was here
/usr/lib/ruby/vendor_ruby/json/common.rb:128: warning: already initialized constant JSON::UnparserError
/var/lib/gems/2.3.0/gems/json-1.8.5/lib/json/common.rb:128: warning: previous definition of UnparserError was here

据我所知,这是一个相当简单的香草装置,所以我无法理解我为获得这些警告所做的工作.我在某种程度上有相互矛盾的宝石吗?如果是这样,我该如何解决?



1> redshift5..:

我设法通过以下方式摆脱JSON警告:

bundle clean --force
bundle

推荐阅读
mobiledu2402851373
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有