Search code examples
ruby-on-railsubuntu-20.04mastodon

Ubuntu 20.04 Gem::LoadError when trying mastodon db migrate


The error:

Gem::LoadError: You have already activated rake 13.0.3, but your Gemfile requires rake 13.0.6.

The command run:

docker-compose run --rm web rake db:migrate

Running this command on my ~/mastodon folder results in the above error.

Countless solutions involving running gem uninstall on various folders, assorted methods of updating, each throwing their own errors. Multiple ruby on rails managers, no luck. I hope one of you can help me get this command to run safely


Solution

  • use bundle exec rake instead of just rake in the command

    EDIT: you can probably do docker-compose run --rm web rails db:migrate instead since it runs bundle internally too but it depends on the rails version