IMPORTANT: Rake not found after installing Rails (RubyInstaller1.9.2-p0 or 1.9.2-p136)

L

Luis Lavena

Hello,

Ruby 1.9.2-p0 included some bundled gems (rake, rdoc and minitest). If
you happen to develop using Rails, will find that after installing
Rails, "rake" command might not work with the following output:

C:\Users\Luis>rake --version
C:/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find
executable rake for rake-0.8.7 (Gem::Exception)
from C:/Ruby192/bin/rake:19:in `<main>'

The issue was corrected in Ruby source code:

http://redmine.ruby-lang.org/issues/show/3805

But during the backports, there was a confusion and it is still
present in latest 1.9.2-p136:

http://redmine.ruby-lang.org/issues/show/4228

To solve this, you need to manually remove rake.gemspec,
minitest.gemspec and rdoc.gemspec files.

With the goal of making things simple, please copy the following into
"clean-gemspec.bat" file and place it in your Ruby 1.9.2 installation
directory:

@echo OFF
SETLOCAL
ECHO This batch file will correct the non-versioned gemspecs distributed
ECHO by RubyInstaller 1.9.2-p136
ECHO.
ECHO Please place this file in the root directory of your Ruby 1.9.2 instal=
l
ECHO (C:\Ruby192 by default)
ECHO.
PAUSE
SET ROOT=3D%CD%\lib\ruby\gems\1.9.1\specifications
ECHO Removing minitest.gemspec from %ROOT%
DEL %ROOT%\minitest.gemspec /Q/F
ECHO Removing rake.gemspec from %ROOT%
DEL %ROOT%\rake.gemspec /Q/F
ECHO Removing rdoc.gemspec from %ROOT%
DEL %ROOT%\rdoc.gemspec /Q/F
ECHO.
ECHO Done. Thank you, and apologies for the problem.
ECHO.

Now, from a command prompt, and inside your Ruby 1.9.2 folder ("CD
C:\Ruby192"), please invoke the batch file:

C:\Ruby192>clean-gemspec.bat

The following will be displayed in your console:

This batch file will correct the non-versioned gemspecs distributed
by RubyInstaller 1.9.2-p136

Please place this file in the root directory of your Ruby 1.9.2 install
(C:\Ruby192 by default)

Press any key to continue . . .
Removing minitest.gemspec from C:\Ruby192\lib\ruby\gems\1.9.1\specification=
s
Removing rake.gemspec from C:\Ruby192\lib\ruby\gems\1.9.1\specifications
Removing rdoc.gemspec from C:\Ruby192\lib\ruby\gems\1.9.1\specifications

Done. Thank you, and apologies for the problem.

=3D=3D=3D=3D

Once that is executed, rake should work again:

C:\Ruby192>rake --version
rake, version 0.8.7

Please apologize the problem this issue might have caused on your
development environment.

Thank you for your time.
--=20
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top