rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.11k stars 552 forks source link

thor-1.1.0 on Ubuntu 20.04.3 Cannot Run Any Rails DB Commands #760

Closed mbarberry closed 2 years ago

mbarberry commented 2 years ago

Been running into an issue running rails db:create, or any other db command.

I get a TypeError: superclass mismatch for class Thor. Coming from gems/gems/thor-1.1.0/lib/thor/command.rb.

I reinstalled ruby-thor on Ubuntu 20.04.3 and still having the same issue.

The only thing that works is: dpkg -r --force-depends ruby-thor gem install thor

But the problem then is that my OS tells me there is a problem with my packages and I cannot update anything. To be able to apply any system updates, I'm required to reinstall the broken package.

dorner commented 2 years ago

Looks like this might happen if you're loading the gem twice for some reason. That file uses class Command < Struct.new which will cause this error if it's loaded twice.

rafaelfranca commented 2 years ago

Thank you for the report but this is more an ubuntu issue than an issue in the thor code. Please report to their issue tracker.

mbarberry commented 2 years ago

I installed rbenv and moved my gem $HOME if anyone runs into this at some point in the future