문제

So far, I've been merely using YARV (ruby 1.9) as merely a faster implementation of ruby than ruby 1.8, and ensured that all of my code is backwards-compatible with ruby 1.8.6. What circumstances, if any, are stopping you from writing 1.9-specific code?

One reason per answer.

도움이 되었습니까?

해결책

Also, if we're talking about rails, then the problem there is the compatibility of gems/plugins with ruby 1.9. I'm sure everyone who wants to upgrade to 1.9 keeps an eye on isitruby19.com

다른 팁

The first release candidate for Ruby 1.9.2 is due end of May and I believe many are waiting for 1.9.2 to hop on the 1.9 train.

Not really an answer to your question, but to start writing code uses 1.9.2 methods now, you can require "backports" and most features will be available to you, even in Ruby 1.8.6 (albeit not nearly as fast, of course).

I wish I could forget about Iconv when handling unicode data, like this:

Iconv.conv("utf-8", "utf-16le", blob).split("\n")

but so far I could not find good examples/tutorial of 1.9 unicode handling yet.

Nothing is discouraging me. I've been using Ruby 1.9.1 for everything I do for close to a year now and had few problems. My major gems require 1.9 for various reasons (easy UTF-8, fibers, etc.) and I've felt no qualms about it. For some other trivial gems I might make a token effort to keep them 1.8 compatible, which mostly just means not using the cleaner new hash syntax.

1.9 is the current Ruby. I can see needing to keep the old Ruby around for legacy code that isn't worth updating, or having a preference for an alternative Ruby (JRuby, Rubinius, etc.) -- but it truly baffles me why so many people are still starting new projects in the slower, obsolete Ruby 1.8.x line.

In many operating systems, it is easier to install ruby 1.8 than ruby 1.9.

  • Some distributions of Linux have packages for 1.8 but not for 1.9.
  • OS X has ruby 1.8.7 pre-installed. 1.8.7 runs the ruby 1.9 language.
  • The one-click installer for Windows is ruby 1.8.

I don't know Ruby so well to distinguish 1.8 from 1.9 ( well that's my reason :P )

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top