Could not find rake with bundle exec

2019-02-09 15:03发布

When I try execute 'bundle exec rake anything', I get error:

Could not find rake-10.1.0 in any of the sources.
Run `bundle install` to install missing gems.

But when I execute simple 'rake anything', rake is working.

Of cause, I tried setup gem any way, which I know:

  • gem install rake -v=10.1.0
  • Wrote "gem 'rake', '10.1.0'" in Gemfile, then execute bundle install
  • I installed gem for all rvm: rvm all do gem install rake -v 10.1.0

This situation really frustration, because simple rake works, but with bundle exec doesn't want.

I need execute rake with bundle exec

Really need your help!

4条回答
forever°为你锁心
2楼-- · 2019-02-09 15:32

I had this problem with an AWS instance, managed by OpsWorks. I was logged in as ec2user. I switched over to the deploy user via sudo su - deploy and ran the bundle command again and it completed without error

查看更多
贪生不怕死
3楼-- · 2019-02-09 15:34

I got a similar error when I tried running 'bundle exec $EXECUTABLE' without running 'bundle install' first :|

查看更多
对你真心纯属浪费
4楼-- · 2019-02-09 15:50

I have the same problem and my solution was: Delete my gemfile.lock

rm Gemfile.lock

donwgrade rake in my gemfile

gem 'rake', '10.0.2'

finally

bundle install
查看更多
趁早两清
5楼-- · 2019-02-09 15:53

I had the same issue, with exactly the same error message, with the same Ruby version yesterday. I solved it by removing this line from .bundle/config in my repository:

BUNDLE_DISABLE_SHARED_GEMS: '1'
查看更多
登录 后发表回答