Deepak Mahakale
Deepak Mahakale

Reputation: 23671

Upgrading from Rails 4 to Rails 5

I have an existing rails app up and running on heroku.

I want to upgrade my application to Rails 5 what are the things I should keep in mind to upgrade applications without errors.

This is my Gemfile

source 'https://rubygems.org'

gem 'rails', '4.2.6'
gem 'sass-rails', '5.0.4'
gem 'haml-rails', '0.9.0'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.1.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '2.5.3'
gem 'jbuilder', '2.5.0'
gem 'sdoc', '0.4.1', group: :doc
gem 'wicked_pdf', '1.0.6'
gem 'wkhtmltopdf-binary', '0.12.3'
gem 'fusioncharts-rails', '0.0.2'
gem 'redcarpet'
gem 'rouge'
gem 'rails-i18n', '~> 4.0'
gem 'devise'

group :development, :test do
  gem 'sqlite3', '1.3.11'
  gem 'byebug', '9.0.5'
  gem 'rspec-rails', '3.4.2'
end

group :production do
  gem 'pg', '0.18.4'
end

I am using ruby 2.2.4 and rails 4.2.6

I also have test cases for the application

Upvotes: 1

Views: 3062

Answers (1)

Tushar H
Tushar H

Reputation: 805

If you're upgrading an existing application to rails 5.0.0.1 then it's a great idea. It will not ruin your application but it may affect your application in some areas. Below few points you should look for:

1) Rails 5.0.0 requires ruby version 2.2.2 or newer to work, so in your case its 2.2.4 which is ok.

2) Rails version numbers are in the form Major, Minor, Patch. Major and Minor versions are allowed to make changes to the public API, so this may cause errors in your application.

3) Some of existing unit test case may fail, so You may also have to update some code to fix those.

4) You'll probably need to check/update for some of your gems versions for support in rails5.

So before proceeding to update, carefully read the 5.0 release notes and make note of things that might affect your app.

Here is a guide for upgrading to Rails 5.0:

http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html

Also this question is duplicate of: How to upgrade from rails 4.2.6 to rails 5.0

Upvotes: 3

Related Questions