Upgrade ruby projects from 1.8.6 to 1.8.7 - ruby

What steps should I follow to upgrade a Ruby project from 1.8.6 to 1.8.7?

It should be mostly seamless, since it was mostly compatible changes to the api.
Still, check out the list of incompatibilities
If you start using the new methods offered by 1.8.7 (or newer!) but would like to remain compatible with 1.8.6, checkout my backports gem.

There are just method add in ruby 1.8.7 in compare to ruby 1.8.6. So if it's works with 1.8.6 it's works in ruby 1.8.7 too.
But if you are a great test suite, launch it and see if all works.

It's a point release. You shouldn't have to do anything.

hey, read this http://casperfabricius.com/site/2010/01/24/multiple-ruby-versions-with-rvm/
it takes you through the installation and setup of Ruby Version Manager - which makes it really easy to switch between different versions of ruby in linux (and mac I think) - if you are on windows, then use this, it's called pik http://github.com/vertiginous/pik/

Related

which ruby version should i use with sass on windows 64-bit

First of all i just want to install ruby to use sass.
My os is Windows 7 64-bit.
Like recommended on the Sass website:
The fastest way to get Ruby on your Windows computer is to use Ruby
Installer
but here it is not clear which version to use. Quote from the Ruby website:
If you don’t know what version to install and you’re getting started
with Ruby, we recommend you use Ruby 2.1.X installers.
[...]
The 64-bit versions of Ruby are relatively new on the Windows
area and not all the packages have been updated to be compatible with
it. To use this version you will require some knowledge about
compilers and solving dependency issues, which might be too
complicated if you just want to play with the language."
So normally I would install version Ruby 2.2.3 (x64) (which is the newest by now) but after reading the website I tend to Ruby 2.1.7 (not even Ruby 2.1.7 (x64))
I really searched a lot on this topic with google but was not able to get any profound information.
First question: x86_64 or 32 bits
In my experience you should focus on the gem you want to use. Maybe some gems with C code are not ready to be used/compiled on x86_64 OS.
the sass is written in ruby and it depends on yard and maruku (source : https://github.com/sass/sass/blob/stable/sass.gemspec)
maruku doesn't seem to have any dependencies (https://github.com/bhollis/maruku/blob/master/maruku.gemspec) and is written in ruby.
I have looked for yard and it seems that it is a full ruby gem without any dependencies.
That means that the ruby version OS you use shouldn't be a problem (there is no compilation of C code to be done ...).
The other question is the ruby version.
The problem could come from the Ruby 2.2.3 version (32 bits or 64 bits)
This version is relatively new with some changes that needed some adjustments for some gems.
So use 32 bits you can use all the gems you want, and don't try to use the last version of ruby unless you want to try the latest functionalities that have been implemented.
TL;DR: use the Ruby 2.1X installers as they say.

Update Ruby from 1.9.3 to 2.0.0 on Windows 7

I installed Ruby using this software:
http://rubyinstaller.org/
However, unlike rvm, I'm not sure if I can use it to update my version of Ruby.
Can I use this to update? If not, what's the best way to update Ruby on a Windows machine?
Looking at the RubyInstaller FAQ, there is this question:
Q: If I install both versions, is there some graceful way of selecting which version is active at a given time (e.g., which ruby.exe is invoked, which irb.bat is called, etc.)?
A: Pik is excellent for this coordination—check it out
One can extend the both in the question to all three (1.8, 1.9 and 2.0), so hopefully pik is forward-compatible with Ruby 2.0, so give this a try.

How to introduce bundler concept in ruby 1.8.6 and rails 2.3.8?

Just I wanted to know whether bundler concept can be introduced in ruby 1.8.6 or does it require ruby 1.8.7 ?.How it can be applied in rails 2.3.8 ?.
Your valuable feedback would be highly appreciated.
bundler requires 1.8.7 (which is pretty ancient and more or less unmaintained at this point).
You can use it with rails 2.3.x - the bundler website has instructions on how to set this up
Really, DO NOT USE the 1.8 ruby series any longer. Compared to 1.9.X it has only disadvantages and is not maintanined any longer. Even gems shouldn't be a problem after all this time since the 1.9 series releases.
Sure, not the exact answer you want to hear, but seriously: upgrade.

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 release?
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!

Learning Ruby - 1.8 or 1.9 version?

I've been learning Python for a while, but the projects I want to do are better suited for Ruby, for example the SAC API for CSS is available in Ruby (and C & Java).
Anyhow, which version of Ruby should I learn right now considering that I'll be building only web apps.
Thanks for your comments and advices.
(Just) because you are planning to build web apps, Ruby 1.8.7 seems to be the most appropriate version for the following reasons:
The Rails ecosystem has still some problem with Ruby 1.9
Ruby Enterprise Edition is based on Ruby 1.8.7 and this is the Ruby interpreter you are likely to use in production unless you don't use jRuby
jRuby is based on Ruby 1.8.7, if you plan to use it
However, you should always keep in mind that Ruby 1.9 is the future. So, avoid using Ruby 1.8.7 deprecated features and you should definitely have a look at the Ruby 1.9 roadmap.
Avoid Ruby 1.8.6. The upcoming Rails release (Rails 3) won't work with Ruby 1.8.6.
Hands down, go with 1.9. There's not that much of a difference if you're a web developer just starting out with Ruby. And by the time you get to the point where the version nuances matter, everything will be on 1.9.
i think you can start in 1.9
its more better..
its nearest future

Resources