➜ Cellar git:(master) brew install ruby ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/ruby-2.2.0.mavericks.bottle.tar.gz Already downloaded: /Library/Caches/Homebrew/ruby-2.2.0.mavericks.bottle.tar.gz ==> Pouring ruby-2.2.0.mavericks.bottle.tar.gz Warning: This keg was marked linked already, continuing anyway /usr/local/Cellar/ruby/2.2.0: 1080 files, 21M ➜ Cellar git:(master)
想问一下 重新安装应该怎么做?
这不已经成功了么?哪里出错了?那个 warning 是说 already linked,你现在运行 ruby --version
应该就是 2.2 了呀。
#5 楼 @knewmei 根据 lz 的话语应该是想要做 web 开发吧。可以看一下Ruby on Rails 教程跟着一步一步做过来就可以了。 然后 ruby 是一门编程语言,通常开发 web 程序的话需要使用rails或者sinatra等 web 框架 (gem)。
删不掉就不删吧!直接装 rbenv 用 rbenv 去装 ruby! 可以参考这个安装:https://github.com/fesplugas/rbenv-installer
➜ ~ gem -v
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:319:in load_file': private method
load' called for Psych:Module (NoMethodError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:192:in initialize'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in
new'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in do_configuration'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in
run'
from /usr/bin/gem:21:in `
这个新装的什么都没有动 也有错误?
#13 楼 @knewmei Mavericks 本来就自带 Ruby,别折腾 Brew 什么的了。根据你的问题,OSX、Ruby、Rails、Homebrew、命令行、语文这几项里面至少有好几项是不熟悉的,搅在一块儿就更难弄懂了。先在命令行里从/usr/bin/ruby
和 /usr/bin/irb
开始吧。
$ /usr/bin/ruby --version
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
$ /usr/bin/irb --version
irb 0.9.6(09/06/30)
这两条命令应该是正常的吧,写到这里忽然发现貌似还用 ZSH + Oh-my-zsh ...