How to change the default minimum version

After installing ruby ​​2.1.2 on my Macbook Pro, I found that the default minimum version is 4.7.5

, I am sodo gem install minitest

for installing minitest 5.4.2

, but the default gem is 4.7.5

. I also do gem cleanup

that does not uninstall the old version. I tried gem uninstall minitest -v 4.7.5

and got

RROR: While executing gem ... (Gem::InstallError) gem "minitest" cannot be uninstalled because it is a default gem

So how can I change the default gem to version 5.4.2 and remove the old one? If I don't change this, I should write class AbcTest < MiniTest::Unit::TestCase

not class AbcTest < Minitest::Test

in my test. Or change the Gemfile every time I create a new project.

PS:

Ruby version: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

gem list minitest -d

minitest (5.4.2, 4.7.5) Author: Ryan Davis Homepage: https://github.com/seattlerb/minitest License: MIT Installed at (5.4.2): /Users/xxxxx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0 (4.7.5, default): /Users/xxxxx/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0 minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking

+3


source to share


2 answers


you can try this to remove the old version:

gem uninstall minitest -v 4.7.5

      



Consult a Guide to Ruby Gems

0


source


I had a similar problem: " How do I make a rake test not use the minimum minitest? "



You can delete the directory ~/.rbenv/versions/2.1.2/lib/ruby/2.1.0/minitest/

. Then your new minitest

gem will be used .

0


source







All Articles