摘要: https://www.v2ex.com/t/234785#reply31.面向字节流的 IO 都有这个问题。 socket 中 tcp 协议是面向流的协议,发送方发送和接收方的接收并不是一一对应的。所以造成所谓的粘包现象。 怎么处理呢? 方法 1 :协议包定长。 每个发送出去的包长度固定。比如都是... 阅读全文
posted @ 2015-11-09 20:12 levyleo 阅读(230) 评论(0) 推荐(0) 编辑
摘要: wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gztar xfvz ruby-2.2.2.tar.gzcd ruby-2.2.2/./configuremakesudo make install 阅读全文
posted @ 2015-11-09 13:30 levyleo 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 下载:http://openssl.org/- ./Configure darwin64-x86_64-cc- make- make test- sudo make install- export PATH="/usr/local/ssl/bin:$PATH"$ which openssl/usr/... 阅读全文
posted @ 2015-11-09 13:29 levyleo 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 安装: gem 应该是ruby自带的ruby包管理器sudo gem install cocoapods卸载:sudo gem uninstall cocoapods 阅读全文
posted @ 2015-11-09 13:28 levyleo 阅读(2986) 评论(0) 推荐(0) 编辑
摘要: gem#查看gem源gem sources# 删除默认的gem源gem sources --remove http://rubygems.org/# 增加taobao作为gem源gem sources -a http://ruby.taobao.org/# 查看当前的gem源gem sources*... 阅读全文
posted @ 2015-11-09 13:27 levyleo 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 安装brew install git卸载git:rm -rf /usr/local/gitrm /etc/paths.d/gitrm /etc/manpaths.d/gitsudo rm -rf /usr/local/git /usr/bin/git /etc/paths.d/git /etc/ma... 阅读全文
posted @ 2015-11-09 13:27 levyleo 阅读(4039) 评论(0) 推荐(0) 编辑
摘要: 更新:brew updatebrew update —system安装, 如:brew install unrar卸载, 如:brew uninstall unrar 阅读全文
posted @ 2015-11-09 13:25 levyleo 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 安装:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"卸载:cd `brew --prefix`rm -rf Cellarbrew prunerm `git ls-fil... 阅读全文
posted @ 2015-11-09 13:25 levyleo 阅读(1243) 评论(0) 推荐(0) 编辑
摘要: 1. #查看当前ruby版本2. $ ruby -v3. ruby 1.8.74. #列出已知的ruby版本5. $ rvm list known6. #安装ruby 1.9.37. $ rvm install 1.9.38. 卸载9. rvm remove 1.9.3 阅读全文
posted @ 2015-11-09 13:24 levyleo 阅读(739) 评论(0) 推荐(0) 编辑
摘要: 安装:curl -L https://get.rvm.io | bash -s stable --autolibs=enabled [--ruby] [--rails] [—trace]$ curl -L get.rvm.io | bash -s stable1. $ source ~/.bashr... 阅读全文
posted @ 2015-11-09 13:23 levyleo 阅读(2239) 评论(0) 推荐(0) 编辑
摘要: Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources1.gem source查看source: 将https://替换成http://gem source -r... 阅读全文
posted @ 2015-11-09 13:22 levyleo 阅读(442) 评论(0) 推荐(0) 编辑