Issue #8482 has been reported by dknight (Amitav Mohanty).

----------------------------------------
Bug #8482: native rake gem has broken path
https://bugs.ruby-lang.org/issues/8482

Author: dknight (Amitav Mohanty)
Status: Open
Priority: High
Assignee: cruby-linux
Category: platform/linux
Target version: 
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


`which rake` has the result /usr/bin/rake but when I try

rake

it fails with the following error

/usr/bin/rake:23:in `load': cannot load such file -- /usr/lib/ruby/gems/2.0.0/gems/rake-0.9.6/bin/rake (LoadError)
        from /usr/bin/rake:23:in `<main>'

gem list rake shows two versions of rake.

*** LOCAL GEMS ***

rake (0.9.6, 0.8.7)

However, when I run 'gem uninstall rake' it directly uninstalls rake-0.8.7. Rake 0.9.6 is obviously a native packaged gem. The issue is /usr/bin/rake points to the wrong rake. Installing and uninstalling rake 0.9.6 does not fix it.

When I was trying to install  ruby-debug-ide-0.4.17.beta16, it was failing because it was not able to load rake.

Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug-ide:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby mkrf_conf.rb

"/usr/bin/ruby" -rubygems /usr/lib/ruby/gems/2.0.0/gems/rake-0.9.6/bin/rake RUBYARCHDIR=/usr/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.17.beta16/lib RUBYLIBDIR=/usr/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.17.beta16/lib
/usr/bin/ruby: No such file or directory -- /usr/lib/ruby/gems/2.0.0/gems/rake-0.9.6/bin/rake (LoadError)


Gem files will remain installed in /usr/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.17.beta16 for inspection.
Results logged to /usr/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.17.beta16/ext/gem_make.out

Also, strangely enough, /usr/lib/ruby/gems/2.0.0/gems/rake-0.8.7/bin/rake -V returns the following rake, version 0.9.6.


-- 
http://bugs.ruby-lang.org/