Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'bundle exec rake' calls nonexistent rake path #495

Closed
wakproductions opened this issue Nov 27, 2013 · 4 comments
Closed

'bundle exec rake' calls nonexistent rake path #495

wakproductions opened this issue Nov 27, 2013 · 4 comments

Comments

@wakproductions
Copy link

I am having an issue with a gem named 'activerecord-sqlserver-adapter' in which I am trying to run tests and bundle exec rake fails with the following error message:

$ bundle exec rake test
/Users/wkotzan/.rbenv/versions/2.0.0-p247/bin/rake:23:in `load': cannot load such file -- /Users/wkotzan/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/specifications/default/bin/rake (LoadError)
    from /Users/wkotzan/.rbenv/versions/2.0.0-p247/bin/rake:23:in `<main>'

For some reason bundle exec is looking for rake in a nonexistent folder, .rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/specifications/default/bin/rake

I currently have another ticket open under the sql server adapter project (rails-sqlserver/activerecord-sqlserver-adapter/issues/291) but my research has brought me to the following PATH problem on rbenv, and I was wondering if it could be related:
/issues/121
/issues/95
sstephenson/rbenv/commit/db143bb654fe447a462b0d91ba931e0524f234f7

I am using rbenv version 0.4.0 and when I remove the rbenv shims folder from my PATH to just use the system ruby I am able to avoid this particular error.

@mislav
Copy link
Member

mislav commented Nov 27, 2013

  1. Do you have any rbenv plugin related to gemsets, bundler, or binstubs? See rbenv hooks rehash
  2. Is your bundle installed to a shared gem location (default) or vendored in project? See cat .bundle/config
  3. What do bundle show rake and gem list rake say

@wakproductions
Copy link
Author

  1. No rbenv plugins
  2. The bundle is installed to a shared gem location. I do not have a .bundle/config file in the project.
  3. bundle show rake and gem list rake commands give the following output
$ bundle show rake
The gem rake has been deleted. It was installed at:
/Users/wkotzan/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-0.9.6

$ gem list rake
*** LOCAL GEMS ***
rake (10.1.0, 0.9.6)

bundle install does not seem to fix the problem of the deleted rake

@mislav
Copy link
Member

mislav commented Dec 2, 2013

Did you try upgrading RubyGems and bundler? I'm pretty sure the issue is not in rbenv, but that you would be getting the same error even if you were not using a Ruby version manager. The error is bizarre and might get avoided by upgrading RubyGems or bundler, or by manually installing rake:

gem install rake -v '0.9.6'

(assuming 0.9.6 is the version of rake listed in your Gemfile.lock)

@wakproductions
Copy link
Author

gem install rake -v '0.9.6'

seems to have resolved the problem. Thanks!

I am using bundler 1.3.5 and RubyGems 2.0.3. I am confused as to why this problem occurred since I would think that doing bundle install or bundle update would reinstall the missing rake gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants