我刚用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
据我所知,这是一个相当简单的香草装置,所以我无法理解我为获得这些警告所做的工作.我在某种程度上有相互矛盾的宝石吗?如果是这样,我该如何解决?
解决方法
我设法通过以下方式摆脱JSON警告:
bundle clean --force bundle