0

I'm using IntelliJ Idea with the Rubymine plugin, and Heroku plugin, and I'm a bit stumped when it comes to pushing an app to Heroku. I can set it up and actually push the app: off it goes, and launches successfully. But even before I did that I was expecting it to fail because I couldn't find anyway of getting it to do a db:migrate. And so it proved: the app is launched but of course it fails pretty much immediately because there's no DB.

I've looked on the forums, google etc but nothing. Is this something that can only be done from the command line? I would have expected an IDE to be what it says on the tin: Integrated. So I feel I'm missing something. The Run configuration works as I've said, and the Heroku log has no errors, but I need a way to tell it to run the db:migrate before launching.

Any ideas?

ad-johnson
  • 555
  • 3
  • 17

2 Answers2

1

The answer is that it is something that it doesn't do - confirmed by IntelliJ. So in this case, one needs to push the app to Heroku, drop to the command line and run the migration there: heroku run rake db:migrate.

I raised a feature request so this may be something that can be added in the future.

ad-johnson
  • 555
  • 3
  • 17
0

I haven't figured out how to do this automatically as part of the RubyMine/JetBrains Heroku Plugin. But you can cobble this together from other sources.

  1. Start with this gist that creates rake tasks for Heroku operations provided by this answer to a similar question:

  2. Then create a new run configurations for each Rake task that you will be using at some point. You will need at minimum push and migrate. But the other tasks might interest you.

  3. Then create a new compound run configuration calling the Rake tasks you created in step 2 in the correct order.

Step 2 and 3 can be consolidated by creating one rake task for migration, and adding a before rake task to push. But that's kind of counter intuitive.

Note: that this approach does require you to have the Heroku CLI installed and configured with valid credentials.

Community
  • 1
  • 1
EmFi
  • 23,435
  • 3
  • 57
  • 68