Mavericks system Ruby and gem broken

荒凉一梦 提交于 2019-12-13 04:40:00

问题


When I tried to run ruby -v or gem -v (or any other command), I get:

dyld: lazy symbol binding failed: Symbol not found: _ruby_run
  Referenced from: /usr/local/bin/ruby
  Expected in: /usr/lib/libruby.dylib

dyld: Symbol not found: _ruby_run
  Referenced from: /usr/local/bin/ruby
  Expected in: /usr/lib/libruby.dylib

This is after I ran rvm system to temporally switch to the system default Ruby. RVM is working fine, but I have a special need to install a gem to the system Ruby and I can't because of this problem.

Does anyone know why? It seems to be some kind of link problem to Ruby, but I'm don't know how to solve this.

I ran which ruby and it's at this point located in "/usr/local/bin/ruby".

I checked the Ruby in "/usr/lib/" and it's pointing to my system Ruby: "../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby"

Any help would be appreciated.


回答1:


The answer is Mavericks broke the homebrew installed Ruby. I just need to reinstall and force link it to make the error message go away.

In case anyone is interested, for CodeKit to work correctly using an external compass executable, just find your compass file, copy it over to /usr/bin, and point to it in the app.




回答2:


This worked for me. I changed the symbolic link for libruby back to lib ruby.1.8.6.dylib

$ sudo cp -p /usr/local/lib/libruby.1.8.6.dylib /usr/lib
$ cd /usr/lib
$ sudo rm libruby.dylib
$ sudo ln -s libruby.1.8.6.dylib libruby.dylib

If you need to go back to Ruby 2.0

$ sudo rm libruby.dylib
$ sudo ln -s libruby.2.0.0.dylib libruby.dylib


来源:https://stackoverflow.com/questions/19803736/mavericks-system-ruby-and-gem-broken

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