macvim icon indicating copy to clipboard operation
macvim copied to clipboard

can not load /usr/local/opt/ruby/lib/libruby.dylib

Open JoyCood opened this issue 5 years ago • 5 comments

Describe the bug E370: can not load /usr/local/opt/ruby/lib/libruby.dylib

To Reproduce

  1. Type :ruby 1
  2. Error: E370: can not load /usr/local/opt/ruby/lib/libruby.dylib

Expected behavior no error

Environment (please complete the following information): :version VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 19 2020 21:23:05) MacVim 8.2.2164 macOS version 11.0.1 Big Sur M1 包含补丁: 1-2164 编译者 [email protected] 巨型版本 带 MacVim 图形界面。 可使用(+)与不可使用(-)的功能: +acl +cmdline_compl +emacs_tags +iconv +menu +multi_lang +python3/dyn +tag_binary +user_commands +xim +arabic +cmdline_hist +eval +insert_expand +mksession -mzscheme +quickfix -tag_old_static +vartabs -xpm +autocmd +cmdline_info +ex_extra +ipv6 +modify_fname +netbeans_intg +reltime -tag_any_white +vertsplit -xsmp +autochdir +comments +extra_search +job +mouse +num64 +rightleft -tcl +virtualedit -xterm_clipboard -autoservername +conceal -farsi +jumplist +mouseshape +odbeditor +ruby/dyn +termguicolors +visual -xterm_save +balloon_eval +cryptv +file_in_path +keymap +mouse_dec +packages +scrollbind +terminal +visualextra +balloon_eval_term +cscope +find_in_path +lambda -mouse_gpm +path_extra +signs +terminfo +viminfo +browse +cursorbind +float +langmap -mouse_jsbterm +perl/dyn +smartindent +termresponse +vreplace ++builtin_terms +cursorshape +folding +libcall +mouse_netterm +persistent_undo -sound +textobjects +wildignore +byte_offset +dialog_con_gui -footer +linebreak +mouse_sgr +popupwin +spell +textprop +wildmenu +channel +diff +fork() +lispindent -mouse_sysmouse +postscript +startuptime +timers +windows +cindent +digraphs +fullscreen +listcmds +mouse_urxvt +printer +statusline +title +writebackup +clientserver +dnd +gettext +localmap +mouse_xterm +profile -sun_workshop +toolbar -X11 +clipboard -ebcdic -hangul_input +lua/dyn +multi_byte +python/dyn +syntax +transparency -xfontset 系统 vimrc 文件: "$VIM/vimrc" 用户 vimrc 文件: "$HOME/.vimrc" 第二用户 vimrc 文件: "~/.vim/vimrc" 用户 exrc 文件: "$HOME/.exrc" 系统 gvimrc 文件: "$VIM/gvimrc" 用户 gvimrc 文件: "$HOME/.gvimrc" 第二用户 gvimrc 文件: "~/.vim/gvimrc" defaults file: "$VIMRUNTIME/defaults.vim" 系统菜单文件: "$VIMRUNTIME/menu.vim" $VIM 预设值: "/Applications/MacVim.app/Contents/Resources/vim" 编译方式: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -arch x86_64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshad ow -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations -Wno-error=unused-function 链接方式: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/[email protected]/lib -L/usr/local/opt/readline/lib -L. -fstack-protector-strong -L/usr/local/lib -L/ usr/local/opt/libyaml/lib -L/usr/local/opt/[email protected]/lib -L/usr/local/opt/readline/lib -arch x86_64 -L/usr/local/lib -o Vim -lm -lncurses -liconv /usr/local/lib/libintl.a -framework AppKit -fs tack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE

JoyCood avatar Jan 11 '21 06:01 JoyCood

Just to make sure I undertand, you have a M1 Mac right?

ychin avatar Jan 11 '21 10:01 ychin

Just to make sure I undertand, you have a M1 Mac right?

yes

JoyCood avatar Jan 12 '21 03:01 JoyCood

  1. Can you check if you have native ruby there?
  2. If yes, can you download a x64 ruby and set rubydll in vimrc?

eirnym avatar Feb 09 '21 23:02 eirnym

I'm using macOS 12.1 (21C52), Kernel Version: Darwin 21.2.0. VIM - Vi IMproved 8.2, I installed it via brew ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21]

Vim is built-in. I reinstall these with brew then relink its in .zshrc. because terminal still use the old if i didn't relink to the newer. the default vim was in /usr/bin, then i relink to /usr/local/Cellar/vim/8.2.3800 as my new vim from brew. then i write this in .zshrc : export PATH="/usr/bin/vim:/usr/local/Cellar/vim/8.2.3800/bin:$PATH"

then i can't use vim and terminal displays

dyld[7239]: Library not loaded: /usr/local/opt/ruby/lib/libruby.3.0.dylib
Referenced from: /usr/local/Cellar/vim/8.2.3800/bin/vim
Reason: tried: 

'/usr/local/opt/ruby/lib/libruby.3.0.dylib' (no such file), 
'/usr/local/lib/libruby.3.0.dylib' (no such file), 
'/usr/lib/libruby.3.0.dylib' (no such file)

zsh: abort      vim

what i'm doing is just copy the libruby.3.0.dylib that was located in ruby or rbenv folder. hehe. it works.

ihsanpraditya avatar Dec 16 '21 21:12 ihsanpraditya

@ihsanpraditya please, answer following questions:

  • macOS architecture
  • MacVim achitecture
  • if you installed vim over MacVim
  • ruby architecture
  • MacVim version

eirnym avatar Dec 17 '21 08:12 eirnym