Need to add minitest to Gemfile

Jason Guiditta jguiditt at redhat.com
Thu Aug 9 17:36:29 UTC 2012


On 09/08/12 09:18 -0700, Crag Wolfe wrote:
>On 08/09/2012 06:46 AM, Jason Guiditta wrote:
>>On 08/08/12 17:22 -0700, Crag Wolfe wrote:
>>>conductor/src/Gemfile currently does not have a dependency for
>>>minitest, but it should. I ran into this while trying to run "bundle
>>>exec rake spec" and "bundle exec rake cucumber" in a
>>>bundler-development environment (thanks Richard for helping me debug
>>>this).
>>>
>>>I'm not certain whether this dependency belongs in the top section as
>>>"gem 'minitest' (which works fine for me) or just under "group
>>>:development, :test do"
>>>
>>>--Crag
>>>
>>>P.S. Is there a reason we don't have the lists of gems in Gemfile
>>>alphabetized? :-)
>>
>>Where do you see a dep needed on minitest? I have an rvm gemset with
>>only gems install by bundler (which does not include minitest), and it
>>seems fine. If we really did need it for some reason, where it
>>goes should be the dev/test block - requiring a test library to run
>>the main app would be madness and a bug to be fixed, imo.
>>
>>-j
>
>I am just using Bundler, not rvm.  FWIW, this particular test is on 
>FC17.  The error I get is pasted below, the main hint being "cannot 
>load such file -- minitest/unit (LoadError)".  This error goes away 
>when I add minitest to the Gemfile and refresh my gems with "bundle 
>install". So, not sure why it is not an issue in rvm (is it doing some 
>extra Gem magic?) but clearly looks to be an issue just using Bundler.
>
>$ bundle exec rake cucumber
>===== boot.rb will try and use bundler =========
>===== application.rb will try and use bundler =========
>Failed to load /home/prince/w1/conductor/src/config/oauth.json, 
>continuing without OAuth support. Run rake dc:oauth_keys and restart 
>Conductor to enable.
>/usr/bin/ruby -S bundle exec cucumber  --profile default
>Using the default profile...
>===== boot.rb will try and use bundler =========
>===== application.rb will try and use bundler =========
>DEPRECATION WARNING: Calling set_table_name is deprecated. Please use 
>`self.table_name = 'the_name'` instead. (called from <top (required)> 
>at /home/prince/w1/conductor/src/
>config/environment.rb:23)
>Failed to load /home/prince/w1/conductor/src/config/oauth.json, 
>continuing without OAuth support. Run rake dc:oauth_keys and restart 
>Conductor to enable.
>DEPRECATION WARNING: Calling set_table_name is deprecated. Please use 
>`self.table_name = 'the_name'` instead. (called from <class:Quota> at 
>/home/prince/w1/conductor/src/app
>/models/quota.rb:37)
>DEPRECATION WARNING: Calling set_primary_key is deprecated. Please use 
>`self.primary_key = 'the_name'` instead. (called from 
><class:ViewState> at /home/prince/w1/conductor/s
>rc/app/models/view_state.rb:33)
>cannot load such file -- minitest/unit (LoadError)
>/home/prince/w1/bundler/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in 
>`require'
>/home/prince/w1/bundler/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in 
>`block in require'
>.....
>
Actually, after a quick look, it appears minitest is part of ruby 1.9,
so since you are on f17, I suspect the issue is there. To attempt to
test this, I spun up a new f17 vm and installed ruby(nothing of ours).
I then ran:
$ irb
irb(main):001:0> require 'minitest/unit'
LoadError: cannot load such file -- minitest/unit

F17 installs ruby 1.9.3, fwiw, your example shows 1.9.1 - but I dont
think that is the problem.

Same error, so good indicator there.  I ran the same experiment on
rvm+ruby 1.9, and the library loaded.  Then I created a new gemset,
blew away the lock file, and rebuilt it on ruby 1.9 (rvm-installed).
Still no minitest listed there. Then I did a bit of googling, and see
that minitest is, in fact, part of the 1.9 stdlib[1][2], meaning 
installing ruby should get the library for you. Even the github 
page[3] for minitest says the gem is only needed for ruby 1.8.

Back to f17.  yum search minitest gets me a rubygem.  I have more
searching to do, but I vaguely recall some discussion on ruby-sig
about splitting out some parts of ruby libraries into separately
installable rpms, for the purpose of allowing them to be updated
independently for errata/bugfixes, for example.  I am going to search
the archive and reply again shortly, but wanted to get this mail out n
case you are beating your head against it still.  

However, all this still doesn't answer the question of why minitest is
being required in the first place, or by whom.  Grepping for
'minitest' in activesupport gem dir returned nothing for me, so think
that is not the culprit. I also grepped in the specifications
directory, and found references to it in a number of libraries, but
they are all listed as developer_dependencies, unless you have a
version of rubygems < 1.2.0. This is not the case is it?  If not, have
you made any changes to your Gemfile? I can continue to help debug
this if needed, ping me later on irc - perhaps I can replicate your
steps to see where things mught have gone wrong.

-j

[1]
http://www.rubyinside.com/a-minitestspec-tutorial-elegant-spec-style-testing-that-comes-with-ruby-5354.html
[2]
http://www.bootspring.com/2010/09/22/minitest-rubys-test-framework/
[3] https://github.com/seattlerb/minitest



More information about the aeolus-devel mailing list