How to Upgrade Ruby to 2.0

How can I update Ruby version 2.0.0 to the latest version in Mac OS X v10.10 (Yosemite)?

Open your terminal and run

curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable

When this is complete, you need to restart your terminal for the rvm command to work.

Now, run rvm list known

This shows the list of versions of the Ruby interpreter.

Now, run rvm install ruby@latest to get the latest Ruby version.

If you type ruby -v in the terminal, you should see ruby X.X.X.

If it still shows you ruby 2.0., run rvm use ruby-X.X.X --default.

Prerequisites for Windows 10:

  • C compiler. You can use http://www.mingw.org/
  • make command available otherwise it will complain that "bash: make: command not found". You can install it by running mingw-get install msys-make
  • Add "C:\MinGW\msys\1.0\bin" and "C:\MinGW\bin" to your path environment variable

How to upgrade Ruby to 2.0

Pik let you play with and manage multiple versions and flavours of ruby on on your Windows box. I have chosen this way because I'm not sure that everything I need will work on the first try with the new version, hence I want also to keep prior versions.

The installation is also simple: if you haven't jet Pik see topic: "Install pik using rubygems" then "pik install ruby 2.0.0"

for example:

Before

C:\Sites>pik list
160: jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java H...
165: jruby 1.6.5.1 (ruby-1.9.2-p312) (2012-01-25 fffffff) (Java HotSpot(T...
167: jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM)...
187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
192: ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
* 193: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

Install

C:\Sites>pik install ruby 2.0.0
** Downloading: http://rubyforge.org/frs/download.php/76807/ruby-2.0.0-p0-i386-
mingw32.7z
...

After installation

C:\Sites>pik list
160: jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java H...
165: jruby 1.6.5.1 (ruby-1.9.2-p312) (2012-01-25 fffffff) (Java HotSpot(T...
167: jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM)...
187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
192: ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
* 193: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
200: ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

Now we can use version 2.0.0

C:\Sites>pik use 200

C:\Sites>ruby --version
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

Wondering where the hell are the Ruby folders

 C:\>echo %HOME%
C:\Users\rondinif

C:\>where ruby
C:\Users\rondinif\.pik\rubies\Ruby-200-p0\bin\ruby.exe

C:\>pik use 193
C:\>where ruby
C:\RailsInstaller\Ruby1.9.3\bin\ruby.exe

C:\>pik use 167
C:\>where ruby
INFO: Could not find files for the given pattern(s).
C:\>where jruby
C:\Users\rondinif\.pik\rubies\JRuby-167\bin\jruby

and so on...

Updating Ruby to 2.0.0 using Pik

I had the same problem - if you follow the instructions listed (ie installing devkit and following their directions [they don't actually tell you to use rubyinstaller]), you'll be fine. Also make sure that during the init phase of the Devkit instructions that it doesn't miss any of your ruby installations.

A note though, it seems that pik can't specify the x64 version of 2.0.0, so you may run into problems if that's the case. In the end I had to use the rubyinstaller for the x64 version of ruby, and then ran the x64 version of the devkit.

Hope this helps.

Stuck on ruby -v ruby 2.0.0p648 even though 2.3.1 is installed, how do i get it to change?

Assuming you have RVM installed correctly:

1) Open Terminal.

2) Type rvm list to see which versions of Ruby you have installed.

3) Type rvm use ruby-2.3.1 if you want to use Ruby 2.3.1.

4) Type rvm gemset create Rails500 to create a gemset for Rails 5.0.0

5) Type rvm gemset use Rails500 to make Rails 5.0 your current gemset

6) Type gem install rails -v 5.0.0 to install Rails 5 to your Rails500 gemset

7) Type bundle install bring everything up to date.

Now you have Rails 5.0 running under a Rails500 gemset against Ruby 2.3.1. Remember to use ruby-2.3.1 and use gemset Rails500 whenever you start a new session in Terminal if you want to maintain multiple versions of Ruby and multiple gemsets.

To make a version of Ruby default, type the following into Terminal:

rvm --default use 2.1.1

To keep a default gemset, just rvm gemset use default and make sure you install your gems into that default gemset by use-ing it before installation.

This covers 80% of everything you'll need to know about RVM.

Also, remember to never install rbenv, because it's not compatible with RVM -- stick with one or the other.

EDIT:

It seems you're having problems with your Terminal settings as well.

1) Open Terminal

2) From the Terminal menu, select Preferences

3) Select the Command (complete path) radio button

4) Make sure the text field beneath the radio button reads /bin/bash

5) Close the Preferences dialog and restart Terminal

6) Try using Ruby 2.3.1 via RVM

how to upgrade rails application from ruby 1.9 to 2.0

You need to follow the following steps:

  • Install new Ruby Version
  • Run bundle install (you may need to update some gems and rails)
  • Run tests . (If you have coverage of all of you application. If not run the whole application manually and fix the errors. Most of the errors would be syntax and other small issues.)
  • Your application is migrated.

Update from ruby 2.2.0 to 2.5

It is because you have wrong gem resources.

Try these to correct it

gem sources -r  http://gems.rubyforge.org/
gem sources -r http://gems.github.com
gem sources -a https://rubygems.org/

Then bundle again as you did



Related Topics



Leave a reply



Submit