【问题标题】:Erlang and Yaws setup on MacOS X在 MacOS X 上设置 Erlang 和 Yaws
【发布时间】:2012-07-24 12:26:04
【问题描述】:

我试图在我的 Mac OS X 10.8 上运行 Yaws 1.94,但它崩溃了。我正在运行 Erlang R15B01

我正在使用 macports 通过以下命令进行安装:

sudo port selfupdate

sudo port install erlang +ssl yaws

export ERL_LIBS=/opt/local/lib/yaws/

sudo mkdir /etc/yaws/

sudo cp /opt/local/etc/yaws/yaws.conf.template /etc/yaws/yaws.conf

当我运行 yaws 时,它崩溃了

$ sudo yaws -i --conf /etc/yaws/yaws.conf 

Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:true]

Eshell V5.9.1  (abort with ^G)
1> 
=INFO REPORT==== 25-Jul-2012::16:36:20 ===
Yaws: Using config file /etc/yaws/yaws.conf

=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/var/yaws/ebin"

=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/lib/yaws/ebin"

=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Add path "/opt/local/lib/yaws/examples/ebin"

=INFO REPORT==== 25-Jul-2012::16:36:20 ===
yaws debug:Running with id="default" (localinstall=false) 
Running with debug checks turned on (slower server) 
 to directory "/opt/local/var/log/yaws"

=INFO REPORT==== 25-Jul-2012::16:36:20 ===
    application: yaws
    exited: {shutdown,{yaws_app,start,[normal,[]]}}
    type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})

结果

当我检查周围是否有 yaws 进程 (ps -efw | grep yaws) 并且没有时

我在这里缺少什么?我希望能够在 Mac OS X 上使用 Yaws。谢谢

这是 sasl 的输出

$ sudo yaws -i --conf /etc/yaws/yaws.conf --erlarg '-boot start_sasl'
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:true]


=PROGRESS REPORT==== 26-Jul-2012::15:41:44 ===
      supervisor: {local,sasl_safe_sup}
         started: [{pid,<0.34.0>},
                   {name,alarm_handler},
                   {mfargs,{alarm_handler,start_link,[]}},
                   {restart_type,permanent},
                   {shutdown,2000},
                   {child_type,worker}]

=PROGRESS REPORT==== 26-Jul-2012::15:41:44 ===
      supervisor: {local,sasl_safe_sup}
         started: [{pid,<0.35.0>},
                   {name,overload},
                   {mfargs,{overload,start_link,[]}},
                   {restart_type,permanent},
                   {shutdown,2000},
                   {child_type,worker}]

=PROGRESS REPORT==== 26-Jul-2012::15:41:44 ===
      supervisor: {local,sasl_sup}
         started: [{pid,<0.33.0>},
                   {name,sasl_safe_sup},
                   {mfargs,
                       {supervisor,start_link,
                           [{local,sasl_safe_sup},sasl,safe]}},
                   {restart_type,permanent},
                   {shutdown,infinity},
                   {child_type,supervisor}]

=PROGRESS REPORT==== 26-Jul-2012::15:41:44 ===
      supervisor: {local,sasl_sup}
         started: [{pid,<0.36.0>},
                   {name,release_handler},
                   {mfargs,{release_handler,start_link,[]}},
                   {restart_type,permanent},
                   {shutdown,2000},
                   {child_type,worker}]

=PROGRESS REPORT==== 26-Jul-2012::15:41:44 ===
     application: sasl
      started_at: nonode@nohost

=PROGRESS REPORT==== 26-Jul-2012::15:41:44 ===
      supervisor: {local,yaws_sup}
         started: [{pid,<0.43.0>},
                   {name,yaws_log},
                   {mfargs,{yaws_log,start_link,[]}},
                   {restart_type,permanent},
                   {shutdown,5000},
                   {child_type,worker}]

=PROGRESS REPORT==== 26-Jul-2012::15:41:44 ===
      supervisor: {local,yaws_sup}
         started: [{pid,<0.44.0>},
                   {name,yaws_trace},
                   {mfargs,{yaws_trace,start_link,[]}},
                   {restart_type,permanent},
                   {shutdown,5000},
                   {child_type,worker}]
Eshell V5.9.1  (abort with ^G)
1> 
=INFO REPORT==== 26-Jul-2012::15:41:44 ===
Yaws: Using config file /etc/yaws/yaws.conf

=INFO REPORT==== 26-Jul-2012::15:41:44 ===
yaws debug:Add path "/opt/local/var/yaws/ebin"

=INFO REPORT==== 26-Jul-2012::15:41:44 ===
yaws debug:Add path "/opt/local/lib/yaws/ebin"

=INFO REPORT==== 26-Jul-2012::15:41:44 ===
yaws debug:Add path "/opt/local/lib/yaws/examples/ebin"

=INFO REPORT==== 26-Jul-2012::15:41:44 ===
yaws debug:Running with id="default" (localinstall=false) 
Running with debug checks turned on (slower server) 
Logging to directory "/opt/local/var/log/yaws"

=CRASH REPORT==== 26-Jul-2012::15:41:44 ===
crasher:
initial call: yaws_server:init/1
pid: <0.45.0>
registered_name: []
exception exit: {{badmatch,{error,enotdir}},
                 [{yaws_server,setup_dirs,1,
                               [{file,"yaws_server.erl"},{line,525}]},
                  {yaws_server,init2,5,
                               [{file,"yaws_server.erl"},{line,200}]},
                  {gen_server,init_it,6,
                              [{file,"gen_server.erl"},{line,304}]},
                  {proc_lib,init_p_do_apply,3,
                            [{file,"proc_lib.erl"},{line,227}]}]}
  in function  gen_server:init_it/6 (gen_server.erl, line 328)
ancestors: [yaws_sup,<0.41.0>]
messages: []
links: [<0.42.0>]
dictionary: [{start_time,{{2012,7,26},{15,41,44}}},
              {gc,{gconf,"/opt/local/lib/yaws",false,102,
                         "/opt/local/var/log/yaws",
                         ["/opt/local/var/yaws/ebin",
                          "/opt/local/lib/yaws/ebin",
                          "/opt/local/lib/yaws/examples/ebin"],
                         [],30000,nolimit,400,1000000,8000,nolimit,[],
                         10240,[],1000000,0,
                         ["/opt/local/lib/yaws/include",
                          "/opt/local/lib/yaws/examples/include"],
                         "/usr/bin/php-cgi","Yaws 1.94","default",false,
                         [],yaws_session_server,8}}]
trap_exit: true
status: running
heap_size: 2584
stack_size: 24
reductions: 40977
neighbours:

=SUPERVISOR REPORT==== 26-Jul-2012::15:41:44 ===
 Supervisor: {local,yaws_sup}
 Context:    start_error
 Reason:     {{badmatch,{error,enotdir}},
              [{yaws_server,setup_dirs,1,
                            [{file,"yaws_server.erl"},{line,525}]},
               {yaws_server,init2,5,[{file,"yaws_server.erl"},{line,200}]},
               {gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},
               {proc_lib,init_p_do_apply,3,
                         [{file,"proc_lib.erl"},{line,227}]}]}
 Offender:   [{pid,undefined},
              {name,yaws_server},
              {mfargs,
                  {yaws_server,start_link,
                      [{env,true,false,false,
                           {file,"/etc/yaws/yaws.conf"},
                           false,false,"default"}]}},
              {restart_type,permanent},
              {shutdown,120000},
              {child_type,worker}]


=INFO REPORT==== 26-Jul-2012::15:41:44 ===
application: yaws
exited: {shutdown,{yaws_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})

【问题讨论】:

    标签: macos erlang yaws


    【解决方案1】:

    查看崩溃消息exception exit: {badmatch,{error,enotdir}} 中的错误。这看起来像 yaws 期望在某个地方找到一个目录并找到其他东西。我建议您查看文件yaws_server.erl 中的525 行。您甚至可以输入io:format/2 并查看此时的 yaws 情况。它可能是格式错误的目录名称,可能包含空格。您还可以尝试检查其用于启动的 conf 文件,并查看服务器想要用作docrootPATHS。另外,检查yaws安装目录的权限,以及yaws要查看的所有Directories

    【讨论】:

      【解决方案2】:

      我不确定 Erlang 和 Yaws 构建的起源或可行性,可以通过 macports 检索,所以我不知道它们是否真的有效。我个人不使用 macports,因为我从那里获得的其他软件存在问题。

      要尝试获取有关 Yaws 安装问题的更多信息,请按以下方式启动 Yaws:

      sudo yaws -i --conf /etc/yaws/yaws.conf --erlarg '-boot start_sasl'
      

      希望sasl 可以为我们提供有关潜在问题的更多信息。

      【讨论】:

      • 我已将sasl 的输出附加到原始票证中。那么我可能会为此放弃macports。感谢您的快速回复
      • 我尝试使用来自 git 的版本运行 yaws,即:git clone git://github.com/klacke/yaws.git,然后是 autoconf./configuremake &amp;&amp; sudo make install。当我使用sudo /usr/local/bin/yaws -i --conf /etc/yaws/yaws.conf --erlarg '-boot start_sasl' 运行偏航时,我得到了与上面相同的结果(崩溃)。不知道出了什么问题。
      • 哦,我忘记了,应该也要重新安装erlang
      • 好的,从 http://www.erlang.org/download.html 重新安装 erlang 并从 git clone 重新安装 yaws。得到相同的结果。哈哈。 (我唯一能想到的是/opt/local/bin/yaws 中的 yaws 二进制文件是正确的吗?这是which yaws 的结果)
      • 您可能会检查 HOME 环境变量为 root 用户设置的内容。从 sasl 输出看来,Yaws 在存储某些控制文件的目录中存在问题;这些通常存储在$HOME/.yaws 内的子目录下。
      猜你喜欢
      • 2011-09-14
      • 2014-07-16
      • 2015-03-30
      • 2015-05-04
      • 1970-01-01
      • 1970-01-01
      • 2011-12-12
      • 2013-06-06
      • 2017-06-06
      相关资源
      最近更新 更多