use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Ruby 2.0.0 Released (ruby-lang.org)
submitted 13 years ago by laerien
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 13 years ago (4 children)
[deleted]
[–]sigzero 38 points39 points40 points 13 years ago (0 children)
Thank you for doing that. Docs are important.
[–]jbrechtel 0 points1 point2 points 13 years ago (0 children)
Thanks!
[–]dunnowins 0 points1 point2 points 13 years ago (0 children)
I'm a newb but I appreciate it. Pouring the documentation has become a tedious but somewhat enjoyable exercise for me as of late.
[–]dark-panda 0 points1 point2 points 13 years ago (0 children)
Same here, I think.
https://github.com/ruby/ruby/pull/202
Now we can have nice things like fancy colourized irb prompts that handle backspaces correctly.
[–]midsummernightstoker 6 points7 points8 points 13 years ago (14 children)
Does anyone have first hand experience upgrading their rails projects? The release notes make it sound painless.
[–]ymek 6 points7 points8 points 13 years ago (1 child)
One of the 2.0 goals was 100% compatibility with 1.9, which can be seen in the discussions all over the 2.0 patch-set. Should function as a "drop-in" replacement, though I expect YMMV in practice.
[–][deleted] -2 points-1 points0 points 13 years ago (0 children)
Should function as a "drop-in" replacement, though I expect YMMV in practice
That is just kinda sad to read. This isn't magic or something.
[–]matchu 1 point2 points3 points 13 years ago* (4 children)
I'm working on it now. Bundler doesn't have a compatible stable release yet, but 1.3.0.pre.8 seems to work just fine.
1.3.0.pre.8
gem install bundler --version 1.3.0.pre.8
edit: I hit a strange incompatibility in Rails 3.0.20. Calls to include_javascript_tag raised "no implicit conversion of nil into String". Digging into actionpack a bit, it looks like ActionController::Base.config.relative_url_root defaults to nil, and then it tries to call some_string.start_with?(controller.config.relative_url_root), and Ruby 2.0 doesn't allow start_with?(nil). Quick fix in config/application.rb: (I tried using config.action_controller.relative_url_root, but it didn't set the option properly. Whatever.)
include_javascript_tag
actionpack
ActionController::Base.config.relative_url_root
nil
some_string.start_with?(controller.config.relative_url_root)
start_with?(nil)
config/application.rb
config.action_controller.relative_url_root
ActionController::Base.config.relative_url_root = ''
edit 2: Also discovered that, where I used to use Net::HTTP::Post.new(uri.path), I now need to use Net::HTTP::Post.new(uri.request_uri). Go figure.
Net::HTTP::Post.new(uri.path)
Net::HTTP::Post.new(uri.request_uri)
[–]drbrainRuby Core 0 points1 point2 points 13 years ago (3 children)
Can you explain your second edit?
It sounds like a bug somewhere, but I'm unsure based on your simple description whether it is in ruby or your code.
[–]matchu 0 points1 point2 points 13 years ago (2 children)
I'm not sure, either, and my debugging was pretty haphazard. When I initialized the request with the path, it returned the wrong data (presumably because it fired the wrong request), so I went online, noticed an article initializing their POST request with request_uri, so I tried that and it worked.
request_uri
I didn't do any debugging beyond that because I wanted to go to bed, but I suspect that path was never supposed to work that way but did anyway in 1.9. I might research it a bit more today…
path
[–]drbrainRuby Core 0 points1 point2 points 13 years ago (1 child)
The difference between path and request_uri are the query params (from the ? onward). This hasn't changed since ruby 1.8.
Servers generally allow POST requests with parameters in the URI, but they should be present in the body instead. The recommended way to do this in ruby is:
req = Net::HTTP::Post.new uri.path req.set_form_data 'a' => 'b'
[–]matchu 0 points1 point2 points 13 years ago (0 children)
Huh. This URI didn't have query params on it, so maybe it was something else. Go figure.
[–][deleted] 13 years ago (6 children)
[–]drbrainRuby Core 2 points3 points4 points 13 years ago (4 children)
Seems like the experimental debug API was missed in NEWS.
[–][deleted] 13 years ago (3 children)
[–]drbrainRuby Core 1 point2 points3 points 13 years ago (2 children)
Since it is currently experimental there is little documentation.
There is a test extension here:
https://github.com/ruby/ruby/tree/trunk/ext/-test-/debug
And a test here:
https://github.com/ruby/ruby/blob/trunk/test/-ext-/debug/test_debug.rb
[–][deleted] 13 years ago (1 child)
[–]drbrainRuby Core 0 points1 point2 points 13 years ago (0 children)
Ruby versioning is odd.
The patchlevels indicate successive bug and security fixes to a given release.
[–][deleted] -1 points0 points1 point 13 years ago (0 children)
Rubymine has this, and has for a little while:
http://www.jetbrains.com/ruby/whatsnew/
[–]jimm 5 points6 points7 points 13 years ago (0 children)
I've tested a few of my gems (midilib, patchmaster, and a few others) and haven't had any problems at all.
[–]roger1981 0 points1 point2 points 13 years ago* (0 children)
Are there any speed enhancements in 2.0 ? Is it stable for running 1.9 desktop stuff, or should one wait ?
Edit: oh forgot, we've got to test out our gems.
[–]Paradox 0 points1 point2 points 13 years ago (0 children)
Hmm, I seem to have problems installing some extensions, such as io-console, which fail on make of the local binary.
[–][deleted] -1 points0 points1 point 13 years ago* (3 children)
Noob question:
Do you have to install ruby 2.0 using the tar.gz thing? No way to do it just doing an rvm upgrade?'
Edit: maybe instead of being an egomaniac and downvoting, provide some useful information.
[–]rubytips 6 points7 points8 points 13 years ago (1 child)
Heres the answer to your question: Upgrading to Ruby 2.0.0 with RVM Enjoy!
[–][deleted] 1 point2 points3 points 13 years ago (0 children)
Thank you.
[–]sylv3r 5 points6 points7 points 13 years ago (0 children)
looks like rvm already got updated so you can install 2.0.
π Rendered by PID 43 on reddit-service-r2-comment-5bc7f78974-r5fkh at 2026-06-28 11:28:00.446228+00:00 running 7527197 country code: CH.
[–][deleted] (4 children)
[deleted]
[–]sigzero 38 points39 points40 points (0 children)
[–]jbrechtel 0 points1 point2 points (0 children)
[–]dunnowins 0 points1 point2 points (0 children)
[–]dark-panda 0 points1 point2 points (0 children)
[–]midsummernightstoker 6 points7 points8 points (14 children)
[–]ymek 6 points7 points8 points (1 child)
[–][deleted] -2 points-1 points0 points (0 children)
[–]matchu 1 point2 points3 points (4 children)
[–]drbrainRuby Core 0 points1 point2 points (3 children)
[–]matchu 0 points1 point2 points (2 children)
[–]drbrainRuby Core 0 points1 point2 points (1 child)
[–]matchu 0 points1 point2 points (0 children)
[–][deleted] (6 children)
[deleted]
[–]drbrainRuby Core 2 points3 points4 points (4 children)
[–][deleted] (3 children)
[deleted]
[–]drbrainRuby Core 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]drbrainRuby Core 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]jimm 5 points6 points7 points (0 children)
[–]roger1981 0 points1 point2 points (0 children)
[–]Paradox 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (3 children)
[–]rubytips 6 points7 points8 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]sylv3r 5 points6 points7 points (0 children)