Heroku and ClearDB Error

I have a Ruby on Rails application with mysql database (using gem mysql2). Since Heroku runs postgres, I followed this step to get it working:

$>heroku addons:create cleardb:ignite $>heroku config | grep CLEARDB_DATABASE_URL $>heroku config:set DATABASE_URL='mysql2://my-url' 

As described here .

The problem is that I get this error in the last command:

 Setting config vars and restarting xxxxxx-xxxxx-16407... !!! ▸ Cannot overwrite attachment values DATABASE_URL. 

And my application cannot work:

 2016-03-18T10:31:31.413121+00:00 heroku[run.1567]: State changed from up to complete 2016-03-18T10:31:34.818303+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxx-xxxxx-16407.herokuapp.com request_id=236455b8-7a02-49f0-8e2e-a67341a81580 fwd="151.225.234.109" dyno= connect= service= status=503 bytes= 2016-03-18T10:31:35.308136+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxx-xxxx-16407.herokuapp.com request_id=974dab02-e914-42fb-ad96-5476e30e9d17 fwd="151.225.234.109" dyno= connect= service= status=503 bytes= 2016-03-18T10:31:35.434538+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxx-xxxxx-16407.herokuapp.com request_id=22bfdfd8-9cdf-4e3d-bb13-c616591bd91f fwd="151.225.234.109" dyno= connect= service= status=503 bytes= 

I am already installing packages and rake db: migrate on a heroku machine.

Do you know how I can solve the problem?

+6
source share
2 answers

Thanks to the support of the hero, I solved the problem!

Basically, I needed to uninstall my previous version of the database before starting a new one. Here is what I did:

 $ heroku addons:destroy heroku-postgresql -a NAMEOFTHEAPP 

And repeat the ClearDB installation procedure. Now everything works!

+13
source

You need to delete the old database before adding a new DATABASE_URL by running the following command:

$ heroku addons: destroy heroku-postgresql

I will ask for the name of the application. Or you can directly use

$ heroku addons: destroy heroku-postgresql -a NAMEOFTHEAPP

+6
source

All Articles