RubyGems - Tests fail on Gem install only



I’m trying to package up a new version of my app’s Gem, but am having a
bit of a mindbending problem with installing the Gem, specifically

   gem install --test [package-base-name]

(with the package in the same directory)

performs the installation, but gives me 1 error on the unit-tests, which
wouldn’t mind but they all pass when I run them from Rake, in the
I tried also with testrb (all pass) and also with Rake in the unpacked
installed Gem directory (again, all pass).

I think I managed to track it down to a specific place in the code,
is the following (I’m pretty sure, but I couldn’t find a way to get Gems
to give an error backtrace for this - I just did some puts debugging):

   require 'rdoc/markup/simple_markup'
   require 'rdoc/markup/simple_markup/to_html'

   # ...

   p =
   h =
   result = p.convert(result, h)

(Extracted from

I put a begin/rescue around the failing test-case, and 'p’d the
out, which gave me:

   #<RuntimeError: Unhandled special: Special: type=17, text="RDoc">

As I say, this doesn’t appear at all when running tests from Rake or
testrb, and RDoc rendering works fine the rest of the time. If anyone
shed any light, I’d be most grateful :slight_smile:

(Also, as an aside, should I be considering this a big problem? Is it
common to run tests while installing a Gem, or do most people run them
separately as needed? Also, does Gem keep error reports and so on from
installations, for future reference?)

Thanks in advance for any help,