需要sudo才能在OSx上运行ghci [英] Requiring sudo to run ghci on OSx

查看:266
本文介绍了需要sudo才能在OSx上运行ghci的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我尝试执行ghci时,发生以下错误:

  GHCi,版本7.8.4:http://www.haskell.org/ghc/:?寻求帮助

加载包ghc-prim ...链接...完成。
加载包integer-gmp ...链接...完成。
正在加载软件包...<命令行>:无法加载.so / .DLL for:libiconv.dylib(dlopen(libiconv.dylib,9):image not found)

如果我使用sudo(sudo ghci)执行,它将正常运行。



我尝试使用默认安装程序进行安装,使用自制软件并使用Yann Esposito提供的脚本( http://yannesposito.com/Scratch/en/blog/Safer-Haskell-Install/ ),而不会改变这种行为。我错过了什么?

解决方案

最后,我发现了答案:

问题出在我的DYLD_FALLBACK_LIBRARY_PATH上。该值已定义到我的POSTGRESQL bin文件夹的目录中。所以,我添加了dyld(man dyld)手册页指出的推荐值,重新加载了我的.bash_profile,现在我的ghci,cabal和ghc工作正常。



建议的值是:
$ HOME / lib:/ usr / local / lib:/ lib:/ usr / lib

I've installed the Haskell platform on my OSX (Yosemite).

When I try to execute the ghci, the following error occurs:

GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help

Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... <command line>: can't load .so/.DLL for: libiconv.dylib (dlopen(libiconv.dylib, 9): image not found)

If I execute using sudo (sudo ghci), it runs normally. The same behavior occurs with cabal.

I've tried to install using the default installer, using homebrew and using the script provided by Yann Esposito (http://yannesposito.com/Scratch/en/blog/Safer-Haskell-Install/), without changes in this behavior. Am I missing something?

解决方案

Finally, I've discovered the answer:

The problem is with my DYLD_FALLBACK_LIBRARY_PATH. The value was defined to the directory of my POSTGRESQL bin folder. So, I've appended the recommended values pointed by the man page of dyld (man dyld), reloaded my .bash_profile and now my ghci, cabal and ghc are working smoothly.

The recommended value is: "$HOME/lib:/usr/local/lib:/lib:/usr/lib"

这篇关于需要sudo才能在OSx上运行ghci的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆