Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: Why do I get "warning: already initialized constant JSON::VERSION" when running rake cucumber?

Tags:

I've just set up a Linux Mint box for rails development with rvm. I went ahead and generated a Rails 5 app, set up the mysql connection, added the cucumber-rails gem and then tried to run:

rake cucumber

For some reason, I was met with:

/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

This is, to my knowledge, a fairly plain vanilla installation, so I cannot understand what I've done to earn these warnings. Do I somehow have conflicting gems in place? If so, how do I resolve this?

like image 715
Micah Gideon Modell Avatar asked Jan 14 '17 10:01

Micah Gideon Modell


1 Answers

I managed to get rid of the JSON warnings by:

bundle clean --force
bundle
like image 82
redshift5 Avatar answered Oct 12 '22 06:10

redshift5