Blaine Hatab
Blaine Hatab

Reputation: 1676

How do I use phoenix console (iex) with heroku?

I'm trying to change some data on heroku that I normally do with iex -s , but the following command does nothing.

heroku run iex

Upvotes: 3

Views: 2498

Answers (3)

xji
xji

Reputation: 8277

Note that if you deploy your app to Heroku using the native release mechanism that comes with Mix since Elixir 1.8, you may simply ssh into the running dyno and remote into the running BEAM node:

# In your local terminal
heroku ps:exec
# In the dyno
_build/prod/rel/your_app/bin/your_app remote

This works out of the box.

Upvotes: 1

PatNowak
PatNowak

Reputation: 5812

When dealing with phoenix project just use:

heroku run iex -S mix phoenix.server

To launch the server in your iex console

or simply

heroku run iex -S mix

to compile the files without starting the server.

Upvotes: 5

Blaine Hatab
Blaine Hatab

Reputation: 1676

The command that worked was

heroku run iex -S mix

Upvotes: 6

Related Questions