romenigld
Application isn't started
I am doing the code gnome course (which the application is a Hangman) and I tried to start a module with Application which uses an Agent and is complainig this:
iex(1)> Dictionary.random_word
** (exit) exited in: GenServer.call(Dictionary.Runtime.Server, {:get, &Dictionary.Impl.WordList.random_word/1}, 5000)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(elixir 1.13.0) lib/gen_server.ex:1019: GenServer.call/3
I tried to start with the atom mod: and start_module: on the file mix.exs
def application do
[
# mod: { Dictionary.Runtime.Application, [] },
start_module: { Dictionary.Runtime.Application, [] },
extra_applications: [:logger]
]
end
application.ex:
defmodule Dictionary.Runtime.Application do
use Application
def start(_type, _args) do
Dictionary.Runtime.Server.start_link()
end
end
server.ex :
defmodule Dictionary.Runtime.Server do
@type t :: pid()
@me __MODULE__
alias Dictionary.Impl.WordList
def start_link do
Agent.start_link(&WordList.word_list/0, name: @me)
end
def random_word() do
Agent.get(@me, &WordList.random_word/1)
end
end
Marked As Solved
romenigld
I solved the problem.
I was putting the mod: on a different app.
Rather than to put on the :dictionary app hahaha.
Thank you all guys for the help.
2
Popular in Questions
Hi,
I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Hello, how can I check the Phoenix version ?
Thanks !
New
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
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
Using vs code and installed ElixirLS: support and debugger.
And I got an error popped up on start up says
Failed to run ‘elixir’ comma...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Other popular topics
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
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
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar.
I p...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









