Requiring sudo to run ghci on OSx

我与影子孤独终老i 提交于 2019-12-12 03:44:46

问题


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?


回答1:


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"



来源:https://stackoverflow.com/questions/30958245/requiring-sudo-to-run-ghci-on-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!