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
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
In templates/appointment/index.html.eex:
<%= for appointment <- @appointments do %>
<tr>
<td><%= appoi...
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Hi All,
I set a environment variables in dev.exs , like below code.
when i start server, how can i set the ${enable} value?
thanks.
d...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
Other popular topics
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
Hello, how can I check the Phoenix version ?
Thanks !
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
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
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!)
This post collects co...
New
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
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
- #forms
- #api
- #metaprogramming
- #hex
- #security










