Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails starts with a long list of warnings concerning already initialized constants

Rails starts with a long list of warnings concerning already initialized constants. Here a list of the warnings

/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_LISTIO_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_PRIO_DELTA_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_ARG_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_ATEXIT_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_BC_BASE_MAX
... and many more from the same ruby path

This doesn't seem to produce problems, but it's kind of annoying. Has someone an idea how to fix these warnings?

like image 309
Jochen Kunze Avatar asked Nov 12 '19 10:11

Jochen Kunze


4 Answers

bundle update and bundle clean --force worked when running into the same issue.

like image 95
ejaco Avatar answered Nov 14 '22 21:11

ejaco


bundle clean --force and then bundle update, solved for me too

like image 22
Hena fufa Avatar answered Nov 14 '22 19:11

Hena fufa


This happened for me while I was running tests. I tried bundle clean --force but nothing changed.

Closing and reopening my terminal fixed it. Restarting did too. The first one is easier.

like image 3
Rimian Avatar answered Nov 14 '22 21:11

Rimian


This looks like it could be caused by a conflict between the global gems and the ones in the Rails project managed by bundler: https://github.com/Shopify/bootsnap/issues/112#issuecomment-483789081

like image 2
siegy22 Avatar answered Nov 14 '22 20:11

siegy22