Which Ruby version is preferable?
Is there any reason to use 1.8.7 over 1.9.1 or is it always best to use the latest stable releas开发者_如何学编程e?
Usually, if you are not maintaining scripts written in older versions, then using the latest will be what i would choose, since there will be bug fixes, new features etc...
1.9.1 but I have run into problems.
If you don't know RVM you should look at that cause you can switch between ruby versions depending on which project or error you are getting.
There are some bugs in 1.9.1 that caused problems installing some gems, and that went away when I switched to 1.9.2, so I'd recommend 1.9.2. I'd also choose 1.9.2 over 1.8.7 for learning since there are some new features in 1.9.2 plus speed improvements.
And definitely, use RVM for your installations. It makes it easy to manage Ruby versions and sets of gems.
If you are starting fresh, I would suggest 1.9.2. There are many nice syntactic features over 1.8. I would go straight to 1.9.2, as I have heard there have been some idiosyncrasies with 1.9.1. Most gems are >= 1.9 ready by now.
I also would recommend RVM (http://rvm.beginrescueend.com/). I would start with your default ruby on your system. Install RVM, the then 'rvm install 1.9.2', and you will be on the right track. RVM has a great IRC and google group, if you need help.
RVM will let you test against all versions of Ruby available. Try 'rvm list known' to get the full list.
- MRI Rubies
- JRuby
- Rubinius
- Ruby Enterprise Edition
- MacRuby
- MagLev
- mput
- IronRuby
Hope that helps!
精彩评论