Error running "bundle exec rake" command



I’m using rails 4.2 with ruby 2.3.1 but I got an error when circle ci use command “bundle exec rake” I got this

export RAILS_ENV="test"
export RACK_ENV="test"
bundle exec rake db:create db:structure:load --trace
bundler: failed to load command: rake (/home/ubuntu/***/vendor/bundle/ruby/2.3.0/bin/rake)
NoMethodError: undefined method `activate_bin_path' for Gem:Module
  /home/ubuntu/***/vendor/bundle/ruby/2.3.0/bin/rake:22:in `<top (required)>'

export RAILS_ENV="test"
export RACK_ENV="test"
bundle exec rake db:create db:structure:load --trace
 returned exit code 1

Action failed: rake db:create db:structure:load

I tested via ssh and this error occurs if I run bundle exec rake db:migrate:status or other command bundle exec rake ...

Happy to answer any question that you need.


I’m running into the same issue. I’ve tried using the newer Ubuntu image (14.04) - test pass, but I need the heroku toolbelt to deploy (and that’s not available on the Ubuntu 14.04 environment).

The issue seems to be with the Ruby 2.3.1 upgrade; downgrading solved it for me (but that’s not really an option).


Hi Consti yes issue appears with ruby update, I solved this issue using “rebuild without cache” maybe that work in your case to.


Rebuild without cache worked for me… Thank you :smile:


@aaroalan thanks! “Rebuild without cache” worked for me, too!


Rebuild without cache works, but I have to do it every time I push a branch with a new name. This seems like a bug. It could be fixed with a clear cache button but I can’t find one?


I can’t find this in the web UI, but it can be done with curl and an API token

e.g. curl -X DELETE

Not the best UX, but if it works it works.


it’s weird, I got that issue just when my branch is already in circleci then update ruby version for that branch but when I push a new branch with new ruby version everything work well.


Yeah, that’s what should happen. I’m hoping ours stabilises since erasing the cache.


yeah, it worked for me too, thank you.:slight_smile: :thumbsup:


Thanks for the protip Nicholas!

We actually do have a UI for clearing Dependency and Source caches: