Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Ruby 1.9.3 Preview 1 Released – What’s New?

By Peter Cooper / August 1, 2011

Over on the ruby-talk mailing list, Yuki "Yugui" Sonoda announced the release of Ruby 1.9.3 Preview 1:

I have just released Ruby 1.9.3 preview1. This is the first preview of Ruby 1.9.3 releases.

I know there are still minor known issues on 1.9.3 but I believe it will be fixed before the release of Ruby 1.9.3-p0. Let's try it out. If you have any trouble on it, please let us know it.

Yugui

It's important to note that this is not the latest production release of Ruby 1.9 (that remains Ruby 1.9.2-p290 for now) but is a preview release so you can try out your libraries and other important code ahead of the full production release of Ruby 1.9.3-p0.

Pick up the tarfile of the release at http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-preview1.tar.gz if you fancy a crawl about. If you want to check it out with RVM, instructions follow.

Key Updates

Let's waltz through some of Ruby 1.9.3 preview 1's key updates over the existing Ruby 1.9.2:

  • The load.c patch discussed at length in this post is in! Yes, faster loading times in Rails 3.x should now be yours to enjoy :-)
  • Previously Ruby has been released under a joint GPLv2 and "Ruby" license. Ruby 1.9.3 is now licensed under a joint 2-clause BSD license and the "Ruby" license.
  • The openssl library has new maintainers and is, supposedly, a lot better for it.
  • io/console is an all new library in the standard library. It's by Nobu Nakada and adds console capabilities to IO instances. On inclusion, it adds raw, raw!, getch, echo=, echo?, noecho, winsize, winsize=, iflush, oflush, ioflush methods to IO instances and offers a class method called console. I'll try and write about it soon.
  • test/unit gains parallel test running support
  • Michael Edgar has made some significant improvments to Ripper, the built-in Ruby parser and parser hooks in 1.9. On Hacker News he suggests that "it's close to being ready to power a full Ruby implementation at this point"
  • The pathname and date libraries were reimplemented in C, primarily for performance reasons. A quick benchmark shows significant improvements in Date's performance.

Ruby 1.9.3 is also specifically covered in our Ruby 1.9 Walkthrough, a mega screencast aimed at Ruby 1.8.7 developers who want to learn all about what's new, what's gone, and what's different in Ruby 1.9.2 and 1.9.3.

How to Give 1.9.3 Preview 1 A Try With RVM

If you're using RVM to manage your Ruby installations (and you should - learn how in this video) and you want to give 1.9.3-preview1 a spin, try:

rvm get head
rvm reload
rvm install 1.9.3-preview1
rvm use 1.9.3

I wouldn't advise running an rvm upgrade at this time since it's not production-ready, but you can try installing your usual gems and, ideally, libraries that you develop and maintain so that we can all have a smooth upgrade to 1.9.3 in the next couple of months.

Comments

  1. Kirill Maximov says:

    If you have a error like:
    curl: (60) SSL certificate problem, verify that the CA cert is OK.

    create $HOME/.curlrc file with contents "-k"

    This should make curl happier :)

  2. Jonathan O'Connor says:

    Hi, I tried 1.9.3 preview today, and sadly my rails 2.3.11 app is failing running tests. It also failed in ruby-head installed last Saturday. The problem is that rails is requiring helper files that don't exist. Everything works fine in 1.8.7 and 1.9.2, so I don't think this is a problem with Rails. Maybe it has to do with rubygems (version 1.8.6). Bundler is 1.0.15. Any ideas where I should report this problem.
    Short version of stack trace:
    /myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require': cannot load such file -- action_view/test_case/test_helper (LoadError)
    from /myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
    from /myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:291:in `require_or_load'
    from /myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:250:in `depend_on'
    from /myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:162:in `require_dependency'
    from /myapp/vendor/rails/actionpack/lib/action_controller/helpers.rb:197:in `default_helper_module!'

    Thanks

  3. Alex Kahn says:

    Does this mean that the new lazy sweep GC is not in 1.9.3-preview1 or is it just not mentioned in this post? I would love a link to an article that discusses the GC improvements.

  4. Pingback: 60% Faster Rails bootup with Rails 3.1 with Ruby 1.9.3 | Rob Zolkos

  5. Pingback: The Official Ruby Site Is Proudly Maintained by No-One

  6. Ken Collins says:

    I can confirm that GC tuning did indeed make it into 1.9.3.preview1, but it is a bit noisy. It will echo the new settings anytime the interpreter is invoked. I used this patch https://gist.github.com/1124322 to disable the print statements when installing with RVM.

  7. rahul k says:

    Peter
    I'd be very grateful if you could give some examples of using io/console. The tests run fine, but I am unable to print anything on screen using that code. Is there support for windows and panels ?

    Thanks
    Rahul

  8. Neil says:

    Looks like the date parsing still doesn't support american date formats :(

  9. Peter Cooper says:

    Not ideal but..

    Date.strptime('04/20/2008', '%m/%d/%Y')
  10. Neil says:

    @PeterCooper what is your preferred way of monkeypatching this to work w/ Rails?

  11. roger says:

    Looking forward to finally have File.write

  12. Pingback: Be Prepared for Ruby 1.9.3 and 1.9.4: What’s New and What’s Different

Other Posts to Enjoy

Twitter Mentions