Ilya Krasnov Ilya Krasnov - 8 months ago 62
YAML Question

rake db:dump fails when specifying an environment

I am using the gem yaml_db to generate a db dump.

The regular invocation with

rake db:dump

works as intended. However when I specify another environment like

RAILS_ENV=development-mysql rake db:dump

the command fails with:

Don't know how to build task 'db:dump'

Thanks for your ideas.

Answer Source

Maybe the yaml_db gem is in the development group of your Gemfile. This results in the fact that if you run RAILS_ENV=development-mysql rake db:dump Bundler loads only the general gems and not the gems from development-mysql.

You need to add yaml_db to a group named development-mysql.