Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake versions in different rvm gemsets

I have created a rvm 1.8.7 for running older rails projects.

When I run rake, there is a warning:

WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.

It's due to a newer version of rake is installed:

rake (0.9.2.2, 0.8.7)

by rvm in the @global gemset

$ gem list -d rake

*** LOCAL GEMS ***

rake (0.9.2.2, 0.8.7)
Author: Jim Weirich
Rubyforge: http://rubyforge.org/projects/rake
Homepage: http://rake.rubyforge.org
Installed at (0.9.2.2): /Users/horace/.rvm/gems/ruby-1.8.7-p358@global
             (0.8.7): /Users/horace/.rvm/gems/ruby-1.8.7-p358

Ruby based make-like utility.

If I try to delete rake 0.9.2.2 in the @global gemset, there is a warning:

You have requested to uninstall the gem:
rake-0.9.2.2
rvm-1.11.3.3 depends on [rake (>= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] 

So, how can I use rake 0.8.7 as default in my rvm 1.8.7?

like image 806
ohho Avatar asked Apr 27 '12 03:04

ohho


1 Answers

The gem wrappers for binaries let you specify which version of a particular program you want to run. So you can go

rake _0.8.7_ [stuff]

Or, if you like you could modify the wrapper to use that version by default (but be careful about gems and rvm's that need the newer rake). Change the line

version = ">= 0"

to

version = "= 0.8.7"
like image 170
Michael Slade Avatar answered Nov 03 '22 09:11

Michael Slade