Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails error: superclass mismatch for class StringIO (TypeError)

I am getting an error while creating a ruby on rails project. In command, I created a new project by typing rails new club, then bundle. Now, when I try to create my models and controllers by typing and entering rails g resource Club name, I get this error: superclass mismatch for class StringIO (TypeError).

gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:
in `require': superclass mismatch for class StringIO (TypeError)

I don't even has a class named StringIO, so I'm not sure where it came from.

  • ruby version: 2.6.8
  • rails: 6.1.4.1
like image 897
Paparoo Avatar asked Dec 10 '25 20:12

Paparoo


2 Answers

Try reverting to an earlier version of StringIO

gem install stringio -v 0.1.4

gem uninstall stringio # remove 3.0.0 and 3.0.1
like image 91
Jason Lee Avatar answered Dec 13 '25 13:12

Jason Lee


As others have said on @jason-lee answer, for many people, this can be fixed just by uninstalling the existing stringio then running bundle install again.

    gem uninstall stringio
    bundle
like image 23
New Alexandria Avatar answered Dec 13 '25 13:12

New Alexandria



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!