unthought

unthought

How to get iex -S mix equivalent with a mix release

My app is currently crashing during mix release start with a very odd ecto sql exception, and I would like to verify that eg. the Application env is set correctly, that all debug is turned on, and then maybe manually pull up the app. During local developments it’s possible to get an iex with all the correct dependencies but without booting their otp apps using iex -S mix. With mix release I only seem to be able to get an iex after booting the app as well (start_iex and daemon_iex). How can I get the same effect with an Elixir 1.10 release? Can coerce ‘eval’ to give me an IEx shell?

Marked As Solved

voltone

voltone

You can create an alternative boot script that loads but does not start some applications.

  1. Duplicate releases/0.1.0/start.script to releases/0.1.0/load.script
  2. Remove one or more {apply,{application,start_boot,[app_name,permanent]}} lines, as necessary
  3. Compile the boot script, e.g. elixir -e ":systools.script2boot('releases/0.1.0/load')"
  4. Run the release with the alternative boot script, e.g. RELEASE_BOOT_SCRIPT=load ./bin/app_name start_iex

Or you can start with the built-in boot script start_clean and then manually start specific dependencies you need using Application.ensure_all_started(:some_dependency):

$ RELEASE_BOOT_SCRIPT=start_clean ./bin/app_name start_iex
Erlang/OTP 22 [erts-10.7.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Interactive Elixir (1.10.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(app_name@localhost)1> Application.ensure_all_started(:ssl)
{:ok, [:crypto, :asn1, :public_key, :ssl]}
iex(app_name@localhost)2>

Where Next?

Popular in Questions Top

siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement