2015-12-14 32 views
0

命令後的「混合phoenix.server」總是收到錯誤:應用程序不啓動,給出了錯誤「無法啓動子:Odt.Endpoint」

=INFO REPORT==== 14-Dec-2015::20:55:48 === 

    application: logger 
    exited: stopped 
    type: temporary 

** (Mix) Could not start application odt: Odt.start(:normal, []) returned an error: shutdown: failed to start child: Odt.Endpoint 

** (Exit) shutdown: failed to start child: Phoenix.Endpoint.Server 

** (Exit) shutdown: failed to start child: {:ranch_listener_sup, Odt.Endpoint.HTTP} 

** (Exit) shutdown: failed to start child: :ranch_acceptors_sup 

** (Exit) {:listener_error, Odt.Endpoint.HTTP, :eaddrinuse} 

我怎樣才能解決呢?我究竟做錯了什麼?

+0

剛剛送走的頂部我的頭,我猜想最後一行(:eaddrinuse)意味着某些東西正在使用您試圖爲鳳凰打開的端口。看看你做什麼時得到:http:// localhost:4000。如果您的4000端口上有某些東西,那麼您可以修改dev.exs文件中的端口。 –

+0

謝謝! 經過端口修改所有確定:) – imonah

+1

@imonah考慮回答你自己的問題,以便社區可以從你學到的東西中受益:) – whatyouhide

回答

5

只是讓別人可以找到答案,他們應該遇到這樣的問題:

這條線:

** (Exit) {:listener_error, Odt.Endpoint.HTTP, :eaddrinuse} 

意味着事情已經使用4000端口(這是鳳凰的默認端口) 。請嘗試檢查http://localhost:4000以查看您是否看到任何內容。如果是這樣,那麼通過更改dev.exs文件修改Phoenix打開的端口。

+1

你猜對了,錯誤'EADDRINUSE'的字面意思是「給定的地址已經在使用中「。 http://man7.org/linux/man-pages/man2/bind.2.html#ERRORS –

+0

@PatrickOscity大聲笑 - 我想它會支付我只是檢查文檔。 :) –

1

我使用的是Mac,所以這個答案將是相同的Linux

只需運行lsof -i :4000,看看哪些proceses正在使用的端口。

一旦你確定對應鳳凰(beam.smp)之一,剛剛殺死進程

kill -9 PID

,或者你可以做killall beam.smp

乾杯

相關問題