Warnings when running `rails` command


#1

When I have run rails migrate and rails generate commands, the following warnings have been printed:

/var/lib/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:92: warning: previous definition of VERSION was here
/usr/lib/ruby/2.5.0/fileutils.rb:1188: warning: already initialized constant FileUtils::Entry_::S_IF_DOOR
/var/lib/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1267: warning: previous definition of S_IF_DOOR was here
/usr/lib/ruby/2.5.0/fileutils.rb:1446: warning: already initialized constant FileUtils::Entry_::DIRECTORY_TERM
/var/lib/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1541: warning: previous definition of DIRECTORY_TERM was here
/usr/lib/ruby/2.5.0/fileutils.rb:1448: warning: already initialized constant FileUtils::Entry_::SYSCASE
/var/lib/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1543: warning: previous definition of SYSCASE was here
/usr/lib/ruby/2.5.0/fileutils.rb:1501: warning: already initialized constant FileUtils::OPT_TABLE
/var/lib/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1596: warning: previous definition of OPT_TABLE was here
/usr/lib/ruby/2.5.0/fileutils.rb:1555: warning: already initialized constant FileUtils::LOW_METHODS
/var/lib/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1650: warning: previous definition of LOW_METHODS was here
/usr/lib/ruby/2.5.0/fileutils.rb:1562: warning: already initialized constant FileUtils::METHODS
/var/lib/gems/2.5.0/gems/fileutils-1.1.0/lib/fileutils.rb:1657: warning: previous definition of METHODS was here
/usr/lib/ruby/vendor_ruby/did_you_mean/version.rb:2: warning: already initialized constant DidYouMean::VERSION
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/version.rb:2: warning: previous definition of VERSION was here
/usr/lib/ruby/vendor_ruby/did_you_mean/jaro_winkler.rb:63: warning: already initialized constant DidYouMean::JaroWinkler::WEIGHT
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/jaro_winkler.rb:63: warning: previous definition of WEIGHT was here
/usr/lib/ruby/vendor_ruby/did_you_mean/jaro_winkler.rb:64: warning: already initialized constant DidYouMean::JaroWinkler::THRESHOLD
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/jaro_winkler.rb:64: warning: previous definition of THRESHOLD was here
/usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:9: warning: already initialized constant DidYouMean::VariableNameChecker::NAMES_TO_EXCLUDE
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:9: warning: previous definition of NAMES_TO_EXCLUDE was here
/usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/name_error_checkers.rb:5: warning: already initialized constant DidYouMean::NameErrorCheckers
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb:5: warning: previous definition of NameErrorCheckers was here
/usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/method_name_checker.rb:7: warning: already initialized constant DidYouMean::MethodNameChecker::NAMES_TO_EXCLUDE
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/method_name_checker.rb:7: warning: previous definition of NAMES_TO_EXCLUDE was here
/usr/lib/ruby/vendor_ruby/did_you_mean.rb:34: warning: already initialized constant DidYouMean::SPELL_CHECKERS
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean.rb:87: warning: previous definition of SPELL_CHECKERS was here```

Should I worry about them?  What do they mean?

#2

Is that all of the error?


#3

Sorry for the delay.

Yes, that is all of the error. After that it prints out the expected results of running the commands. I’m not at my personal computer right now so I can’t give the complete output.


#4

Run the following commands

gem uninstall fileutils
gem update --default

Then try again.


#5

Hmm.

I now get the following warnings and errors. I can simply reinstall fileutils and live with the warnings – not sure how important this is.

/usr/lib/ruby/vendor_ruby/did_you_mean/version.rb:2: warning: already initialized constant DidYouMean::VERSION
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/version.rb:2: warning: previous definition of VERSION was here
/usr/lib/ruby/vendor_ruby/did_you_mean/jaro_winkler.rb:63: warning: already initialized constant DidYouMean::JaroWinkler::WEIGHT
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/jaro_winkler.rb:63: warning: previous definition of WEIGHT was here
/usr/lib/ruby/vendor_ruby/did_you_mean/jaro_winkler.rb:64: warning: already initialized constant DidYouMean::JaroWinkler::THRESHOLD
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/jaro_winkler.rb:64: warning: previous definition of THRESHOLD was here
/usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:9: warning: already initialized constant DidYouMean::VariableNameChecker::NAMES_TO_EXCLUDE
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:9: warning: previous definition of NAMES_TO_EXCLUDE was here
/usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/name_error_checkers.rb:5: warning: already initialized constant DidYouMean::NameErrorCheckers
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb:5: warning: previous definition of NameErrorCheckers was here
/usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/method_name_checker.rb:7: warning: already initialized constant DidYouMean::MethodNameChecker::NAMES_TO_EXCLUDE
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/method_name_checker.rb:7: warning: previous definition of NAMES_TO_EXCLUDE was here
/usr/lib/ruby/vendor_ruby/did_you_mean.rb:34: warning: already initialized constant DidYouMean::SPELL_CHECKERS
/var/lib/gems/2.5.0/gems/did_you_mean-1.3.0/lib/did_you_mean.rb:87: warning: previous definition of SPELL_CHECKERS was here
/var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem': Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile. (LoadError)
	from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:12:in `<main>'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
	from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/connection_specification.rb:191:in `spec'
	from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:952:in `establish_connection'
	from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/connection_handling.rb:60:in `establish_connection'
	from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:in `each'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
	from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/base.rb:328:in `<module:ActiveRecord>'
	from /var/lib/gems/2.5.0/gems/activerecord-5.2.2/lib/active_record/base.rb:27:in `<main>'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
	from /var/lib/gems/2.5.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
	from /var/lib/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:356:in `active_record_configured?'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:273:in `disconnect_database'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:107:in `preload'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
	from /var/lib/gems/2.5.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from -e:1:in `<main>'

#6

That seems to be all kinds of wrong.

You could try installing a newer version of Ruby but you’d have to start the rails project all over again.