http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/
完整的更新内容: https://github.com/marcandre/ruby/blob/news/NEWS.rdoc
Today, I'll loose at least 50 karma points, but it's worth: Why people still use Ruby?
- Because they get dream day rates for maintaining rusty slow legacy systems
- Because they do not want to learn new languages and can stay in their comfort zone
- Because they think it's still 2005 and nobody cares about slow server response times And now Ruby lovers, click on downvote or give your reasons why you still use Ruby.
第一条太欢乐了
两个相关演讲,均来自 Ruby Conf 2012 Ruby 2.0 on Rails Implementation Details of Ruby 2.0 VM 讲一半,演讲者还变装,晕。。
Release notes 里说 Rubygems 也已升级到 2.0.0 并作为 Ruby 2.0.0 的一部分发布,但用 rvm 装上的似乎还不是... 得等 Rubygems 真正发布 2.0.0: https://twitter.com/drbrain/status/305564020788830208
bundle install 的时候出现这个
Please upgrade to Bundler 1.3 or higher
但是貌似 bundler 最新版本是 1.2.x 啊 还是再等等升级吧 话说 rails 4 什么时候 release 呀?
#17 楼 @blacktulip 还有 5 个 open issue 啊 https://github.com/rails/rails/issues?milestone=9&state=open
#30 楼 @s6520643 ruby 编译时要加参数 ./configure --with-openssl-dir=/usr/local/opt/openssl
如果你用 brew 安装 ruby 的话,用 https://gist.github.com/windwiny/5026939 这里的内容替换 /usr/local/homebrew/Library/Formula/ruby.rb 文件。里面加上了 openssl 依赖
@huacnlee 问题解决了 https://github.com/carlhuda/bundler/issues/2318 gem install bundler --pre 是安装 1.3.0.pre.8,删除这个版本安装 1.3.0.pre.7
/home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:1176:in `create': cannot interpret as DNS name: nil (ArgumentError)
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:1022:in `generate_candidates'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:1047:in `resolv'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:513:in `each_resource'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:406:in `each_address'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:115:in `block in each_address'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:114:in `each'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:114:in `each_address'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:92:in `getaddress'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:43:in `getaddress'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv-replace.rb:10:in `getaddress'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv-replace.rb:22:in `initialize'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:877:in `open'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:877:in `block in connect'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/timeout.rb:65:in `timeout'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:876:in `connect'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:861:in `do_start'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:850:in `start'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1366:in `request'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1125:in `get'
from /home/john/.rvm/gems/ruby-2.0.0-p0/gems/faraday-0.8.4/lib/faraday/adapter/net_http.rb:72:in `perform_request'
for Mac Users and rbenv users
brew upgrade rbenv
brew upgrade ruby-build 必须的 由于在ruby-build中有ruby version list
rbenv install -l 返回有2.0.0-p0的
export CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=$(brew --prefix readline)"
rbenv install 2.0.0-p0
果然是极快的…… 进 rails console,以前要 15、6 秒,现在只要 5、6 秒的时间; 跑测试前要加载各种文件的,以前要 30 秒,现在只要 10 秒啊亲。
不过小项目貌似不明显
报以下错误 如何处理?
➜ ~ export CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl
--with-readline-dir=brew --prefix readline
"
➜ ~ rbenv install 2.0.0-p0
Downloading openssl-1.0.1e.tar.gz... -> https://www.openssl.org/source/openssl-1.0.1e.tar.gz Installing openssl-1.0.1e...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/0b/ywhs0qyx2235vm2634f1q3fr0000gn/T/ruby-build.20130226210019.31621 Results logged to /var/folders/0b/ywhs0qyx2235vm2634f1q3fr0000gn/T/ruby-build.20130226210019.31621.log
问题解决,问题的原因在 https://github.com/sstephenson/ruby-build/commit/fee1e499fbc0f430b5a32d4f978e54ea740cc50f 需要更新 ruby-build(版本需要晚于 20130225) brew update brew upgrade ruby-build rbenv install 2.0.0-p0 即可:)
[2013-02-27 20:16:43] /Users/ray/.rvm/rubies/ruby-2.0.0-p0/bin/ruby ERROR: While executing gem ... (ArgumentError) invalid byte sequence in US-ASCII RubyGems 2.0.0 installed Parsing documentation for rubygems-2.0.0 Installing ri documentation for rubygems-2.0.0
ruby gem 安装有问题,何解?
这边运气比较好,在 MacOS Lion 10.8 运行 rvm install 2.0.0 没有碰到 openssl 的问题(估计依赖的 package 之前都通过 brew 安装过了),只是在创建新的 gemset 时,bundle install 出现 mysql2 经典问题:
An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
还好最后是解决了。
#56 楼 @ray 我解决你那个问题了,但是还有这样的问题。
deploy@39:~$ gem -v
2.0.0
deploy@39:~$ gem install lazy_high_charts -v '1.3.3'
ERROR: Error installing lazy_high_charts:
lazy_high_charts requires RubyGems version ~> 1.3. Try 'gem update --system' to update RubyGems itself.
deploy@39:~$ gem update --system
Latest version currently installed. Aborting.
deploy@39:~$ gem install rubygems-update
Successfully installed rubygems-update-2.0.0
Parsing documentation for rubygems-update-2.0.0
Done installing documentation for rubygems-update (0 sec).
1 gem installed
deploy@39:~$ update_rubygems
RubyGems 2.0.0 installed
Parsing documentation for rubygems-2.0.0
Installing ri documentation for rubygems-2.0.0
------------------------------------------------------------------------------
RubyGems installed the following executables:
/home/deploy/.rvm/rubies/ruby-2.0.0-p0/bin/gem
Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for ruby libraries. You may access it like this:
ri Classname
ri Classname.class_method
ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.