Update rails from 4.2 to 5.0 on windows - ruby-on-rails

I just installed rails using the awesome rails installer for windows. Unfortunately there is not yet the option available to use the installer for Rails 5, what is the easiest way to upgrade on Windows? I currently have ruby version 2.2.4 and rails 4.2

Check this tutorial:
http://blog.teamtreehouse.com/installing-rails-5-windows
No need to update ruby, because 2.2.2+ versions support new Rails.
Actually you have to run
gem install rails --version 5.0.0

Related

How to change from Ruby On Rails version 6.0.3.2 to Version 5?

I have installed Ruby On Rails version 6.0.3.2 but now I want to change it to Version 5. How can I do it?
Do I uninstall version 6 and install 5? What command should I use please?
You can have multiple versions of a gem installed:
gem install rails -v 5.2.4.4
And all modern rails versions have a way to select which specific one to use when creating a new app:
rails _5.2.4.4_ new application_name
If you want to downgrade an existing app - first search for a commit that upgraded it, if you're very lucky - a simple revert can do the job. But in more general case - you have to make your code compatible with older version (remove new feature usage etc), and fiddle with gem versions inside the Gemfile. Do a bundle update after edit - when a lower version is specified in requirements it will downgrade. Note that rails may be not the only gem requiring downgrade

How to upgrade rails 2.3.12 to 3.x or 4.x versions using JRuby

I used Jruby version 1.6.5.1 which include Ruby 1.8.7, rails 2.3.12. and gem 1.6.2.
How can I upgrade all this versions to higher versions (Jruby 1.7.x, ruby 1.9.x or 2.x and rails 3.x or 4.x)
Thanks in advance.
You can use rvm to manager ruby version
Bellow code lines is use install ruby 1.9.3 on Centos. You can refference it.
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 1.9.3
rvm use 1.9.3 --default
this will be a multi-step process and largely depends on the gems you're using. it really helps if you happen to have test coverage, otherwise it might get a little painful.
here's shortly what I would do (did some 2.3 upgrades previously) :
upgrade JRuby to latest 1.7.x it defaults to 1.9.3 but using --1.8 makes it 1.8.7 compatible
setup Bundler on Rails 2.3 http://bundler.io/v1.11/rails23.html (will help managing the gems)
attempt to upgrade to Rails 3.2 (review an empty created app to adjust the environment/*.rb, environment.rb, boot.rb etc. accordingly) - some gems might need an upgrade or replacing
switch off the --1.8 switch for JRuby ... you'll be running with 1.9.3
(optional) upgrade to Rails 4.x
(optional) upgrade to JRuby 9.0.x
*each step assumes running tests or somehow testing out the app is in a working state.

How to downgrade Ruby and Rails versions without using RVM

I am using Ruby 1.9.3p2 and Rails 4.0 versions on my Linux machine.
Recently we got an maintenance project which is on versions Ruby 1.8.7 and Rails 2.3.2.
I tried of installing rvm, after that it asked to install ree. But it goes on continuously increasing packages to install.
Please tell me if there is any way without using rvm.
Using a version manager is the best way. If you don't want to use rvm, you could try using rbenv, although I prefer rvm.

How can I switch between rails 3.2.13 and rails 4.0.0?

I am using ubuntu 12.04. I have installed ruby 1.9.3 and rails 3.2.13. When I check my version of rails using command rails -v, it shows Rails 4.0. How can I switch to Rails 3.2.13?
As you have already installed rails and its current version is 4.0, so please do this
gem install rails -v 3.2.13 and if you want to remove 4.0 version please do gem uninstall rails, you will get the list of rails and then choose 4.0.0 version.
Simple If you want to switch rails then you can install multiple rails version by using
sudo gem install rails -v 3.2.x or gem install rails or any version you want
If you want to switch ruby version use rvm and choose rvm use 1.9.3 or rvm use 2.0.0
Thanks
rails new appname will use the latest version of rails. To use an earlier installed version, call:
rails _3.2.13_ new appname
You can then have both versions of rails installed and not have to deal with uninstalling rails which can be problematic.

How to downgrade rails version in Max OS X Snow Leopard?

I have Mac OS X Snow leopard that has pre-installed Ruby 1.8.7 and Rails 3.0.1
I need to work with Redmine a bit that requires Rails 2.3.5
Is it possible to correctly downgrade my current rails 3.0.1 to rails 2.3.5?
You don't need to downgrade, RubyGems allow you to install multiple versions of the same library.
$ gem install rails -v 2.3.5
To avoid versioning hell, you can also use rvm, which allows you to install multiple ruby versions and "gemsets" on the same machine and switch between them.

Resources