Create package for Thor 1.0.1

Bug #1885424 reported by Paul Schreiber
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ruby-thor (Ubuntu)

Bug Description

Currently, ruby-thor installs Thor 0.19.4 (released Nov 28, 2016). The most recent version is 1.0.1 (released Dec 17, 2019).

Related bugs:
Thor package:

Using the 0.19.4 version of Thor causes:
   TypeError: superclass mismatch for class Command
in many situations in a Rails app

...such as when the app includes a newer version of Thor. Most apps will hit this, since both jquery-rails and railties have Thor as a dependency.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ruby-thor (Ubuntu):
status: New → Confirmed
Revision history for this message
Richard Viney (richard-nz) wrote :

Ran into this today when trying an Ubuntu 20.04 upgrade on a Rails app.

FWIW I added `gem 'thor', '~> 0.20.3'` to the Rails app's `gems.rb` (aka `Gemfile`) in order to make it go away.

no longer affects: ruby-bundler (Ubuntu)
Revision history for this message
Andy Allan (launchpad-gravitystorm) wrote :

This isn't a problem in the ruby-thor package (although it could do with an update). This is a problem with the ruby-bundler package.

Specifically, the upstream bundler codebase vendors Thor under a separate namespace (Bundler::Thor) to avoid this specific issue. Bundler itself needs Thor, but many projects do too. So to make something like "bundle exec (whatever) work, without version clashes, bundler uses a different namespace for its internal copy of Thor.

The Debian/Ubuntu ruby-bundler package is broken though, since it rips out the carefully vendored code in a specific namespace and uses ruby-thor in the Thor namespace.

Here is the patch that causes the issue:

From: Christian Hofstaedtler <email address hidden>
Date: Thu, 15 Mar 2018 14:51:43 +0100
Subject: Replace bundled libraries with system versions
Forwarded: not-needed

--- a/lib/bundler/vendored_molinillo.rb
+++ b/lib/bundler/vendored_molinillo.rb
@@ -1,4 +1,4 @@
 # frozen_string_literal: true

 module Bundler; end
-require_relative "vendor/molinillo/lib/molinillo"
+require "molinillo"
--- a/lib/bundler/vendored_thor.rb
+++ b/lib/bundler/vendored_thor.rb
@@ -2,7 +2,7 @@

 module Bundler
   def self.require_thor_actions
- require_relative "vendor/thor/lib/thor/actions"
+ require "thor/actions"
-require_relative "vendor/thor/lib/thor"
+require "thor"

Revision history for this message
Richard Viney (richard-viney) wrote :

I think this issue is also affecting Rails 6.1 on the system ruby/ruby-bundler packages. Testing on the latest Ubuntu Focal stable packages:

$ sudo gem install rails -v 6.1.1
$ rails new my-app
$ cd my-app && bundle exec rails db:setup
rails aborted!
TypeError: superclass mismatch for class Command

The workaround mentioned above involving adding "gem 'thor', '~> 0.20.3'" to the Gemfile doesn't work anymore as of Rails 6.1 because railties 6.1 now specifies thor ~> 1.0.

Revision history for this message
Daniel Calcoen (daniel-calcoen) wrote :

Dear Andy thanks a lot for your clear explanation (may the digital god of the bits bless you in everything you code).

I confirm I found this problem in Ubuntu 20.10 having all the latest versions (bundler 2.1.4).

For other user suffering from this, while we wait for the final proper solution, here is a workaround

The involved files installed in your system with the magic broken are:

you can revert the changes or overwrite the files with the ones from the upstream master branch

once the files restored, they will refer to the relative /vendor/molinillo and /vendor/thor directories that were removed in the Ubuntu/Debian distribution so you need to copy both directories from the upstream into


After that you can now bundler with its magic restored :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers