Error running "bundle exec rake" command

rails
ruby

#1

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.


#2

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).


#3

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


#4

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


#5

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


#6

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?


#7

I can’t find this in the web UI, but it can be done with curl and an API token https://circleci.com/docs/api/#clear-cache

e.g. curl -X DELETE https://circleci.com/api/v1/project/:username/:project/build-cache?circle-token=:token

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


#8

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.


#9

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


#10

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


#11

Thanks for the protip Nicholas!

We actually do have a UI for clearing Dependency and Source caches:
https://circleci.com/gh/circleci/frontend/edit#clear-caches


#13