【发布时间】:2016-09-09 20:15:46
【问题描述】:
我尝试在我的 Mac 64 位 Capitan 上安装 ErLang,我尝试通过 brew 安装它,但是当我尝试运行 :observer.start 时出现此错误:
** (UndefinedFunctionError) undefined function :wx_object.start/3 (module :wx_object is not available)
:wx_object.start(:observer_wx, [], [])
observer_wx.erl:72: :observer_wx.start/0
我也尝试使用 erlang 解决方案安装 erLang otp 18.3,但我遇到了同样的错误。
有什么想法吗?
编辑
如果我尝试直接从 Erlang shell 启动观察者:
^CiMac:~ Apple$ erl
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.3 (abort with ^G)
1> observer:start().
** exception error: undefined function wx_object:start/3
in function observer_wx:start/0 (observer_wx.erl, line 72)
EDIT2
iMac:~ Apple$ brew info erlang
erlang: stable 18.3 (bottled), HEAD
Programming language for highly scalable real-time systems
https://www.erlang.org/
/usr/local/Cellar/erlang/18.3 (7,489 files, 273.8M)
Poured from bottle on 2016-05-13 at 12:24:59
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/erlang.rb
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔
Required: openssl ✔
Recommended: wxmac ✔
Optional: fop ✘
==> Options
--with-dirty-schedulers
Enable experimental dirty schedulers
--with-fop
Build with fop support
--with-native-libs
Enable native library compilation
--without-docs
Do not install documentation
--without-hipe
Disable building hipe; fails on various OS X systems
--without-wxmac
Build without wxmac support
--HEAD
Install HEAD version
==> Caveats
Man pages can be found in:
/usr/local/opt/erlang/lib/erlang/man
Access them with `erl -man`, or add this directory to MANPATH.
iMac:~ Apple$ which erl
/opt/local/bin/erl
brew info 的 erl 是:
/usr/local/Cellar/erlang/18.3
但是,哪个erl是:
/opt/local/bin/erl
指向/opt/local/lib/erlang/bin/erl
如果我开始 /usr/local/Cellar/erlang/18.3/bin/erl 观察者将工作!
所以,我用鼠标删除了别名,然后我:
sudo ln -s /usr/local/Cellar/erlang/18.3/lib/erlang/bin/erl /opt/local/bin/erl
但我不确定/opt/local/lib/erlang/bin/erl 它是如何创建的..
无论如何,它现在可以工作了..
【问题讨论】:
-
Erlang 好像没有 WxWidgets。你可以试试
brew info erlang,它会告诉你安装了哪个版本以及是否安装了wxmac依赖。您确定实际上您正在启动正确的erl吗? brew安装的那个? (控制台中的“which erl”是否打印预期的路径?) -
谢谢!,brew info 显示我指的是不同的路径,请参阅编辑 2
-
从源代码编译 Erlang 通常会跳过 wxWidgets、crypto 和 odbc。获得完整 Erlang 的最简单方法是使用来自 Erlang Solutions 站点的软件包:erlang-solutions.com/resources/download.html 请确保不要安装企业软件包(它们是 borken),但标准软件包运行良好并节省时间。
-
@simo 我很高兴它现在可以工作了!那么请接受我的回答:-)
-
当然,我很高兴能用 elixir & Erlang 开始新的旅程 :)