Skip to content

Instantly share code, notes, and snippets.

@kathyonu
Last active February 17, 2025 21:20

Revisions

  1. kathyonu revised this gist Aug 14, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    *Commands to keep your app healthy, Ruby and Rails gems wise.*
    *Commands to keep your app healthy, Ruby and Rails and gems wise using RVM.*

    If you use rbenv, please see [Rails-application-health-codes-rbenv.md](https://gist.github.com/kathyonu/9f9fbb3f49ffcf1fed580b2b06683313)

    *Open new Terminal, note the gemsets showing:*

  2. kathyonu revised this gist Jul 6, 2021. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -86,9 +86,9 @@ Run ..

    `rvm gemset list`

    `gem install rails -v 6.0.0`
    `gem install rails -v 6.1.4`

    The global gemset now contains Ruby 2.6.5 with Rails 6.0.0
    The global gemset now contains Ruby 2.6.7 with Rails 6.1.4

    To better underdstand this process
    I refer you to these instructions:
    @@ -121,9 +121,11 @@ I have two branches, master and staging, perfect mirrors.
    I am in the staging branch.
    I make the new branch:

    `git checkout -b rails526`
    `git checkout -b rails60to61`

    Rails 5 to 6.
    Rails 6.0.3.1 to 6.1.4

    I read the changes for each version, and all will be well.

    Now ..

  3. kathyonu revised this gist Jun 26, 2021. 1 changed file with 8 additions and 16 deletions.
    24 changes: 8 additions & 16 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -108,7 +108,7 @@ Change Directory the app ..
    `rvm gemset list` : still on => global

    Now, I will make a new feature branch, and the reason is,
    upgrading from Rails 4 to Rails 5 is a difficult leap, entailing many
    upgrading from Rails 5 to Rails 6 is a major leap, entailing many
    changes.

    The `git branch` command will show you where you are.
    @@ -134,11 +134,11 @@ Now ..
    We are still using global gemset.
    We now create new gemset for the app, for first time creation use:

    `rvm gemset use Rails6.0.3_your_app_name --create --default`
    `rvm gemset use Rails6.1.4_your_app_name --create --default`

    With above command used once, below is never needed:

    `rvm gemset use Rails6.0.3_your_app_name`
    `rvm gemset use Rails6.1.4_your_app_name`

    Run this command again, you will see the gemset is being used:

    @@ -158,11 +158,11 @@ You can use the command to change gemsets and change back:

    `rvm gemset use Rails5.0.0_your_app_name`

    `rvm gemset use Rails6.0.3_your_app_name`
    `rvm gemset use Rails6.1.4_your_app_name`

    To upgrade your rails version, install Rails wtih this:

    `gem install rails --version 6.0.3`
    `gem install rails --version 6.1.4`

    If all is well on rails response, skip down to

    @@ -187,18 +187,18 @@ Verify your app's gemset with:
    `rvm gemset list`

    Changing gemset will work if you are in wrong one.
    You want to be here: `Rails6.0.3_your_app_name`
    You want to be here: `Rails6.1.4_your_app_name`
    You get there by running this, anytime:

    `rvm gemset use Rails6.0.3_your_app_name`
    `rvm gemset use Rails6.1.4_your_app_name`

    Now run:

    `gem install rails`

    The response is:

    `Successfully installed rails-6.1.3.2`
    `Successfully installed rails-6.1.4`
    `1 gem installed`

    Now run:
    @@ -282,13 +282,5 @@ Your Rails app's health brought to you by

    This list draws heavily upon my learnings with [RailsApps Tutorials](https://tutorials.railsapps.org/).

    If you are looking for a Ruby on Rails Tutorial, go RailsApps,
    where you can truly begin at the beginning and learn your way to
    deploy with confidence. We did.

    Did you know FIXNUM and BIGNUM are aliases for INTEGER in the upgrade to Ruby 2.4.1.
    See:
    [Behavior Changes in Ruby 2.4](https://wyeworks.com/blog/2016/6/22/behavior-changes-in-ruby-2.4)

    Address of __This Rails Applications Health Codes Gist__ is :
    https://gist.github.com/kathyonu/c9ef8190e50422bc0edc
  4. kathyonu revised this gist Jun 25, 2021. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -13,12 +13,12 @@ Keep your system up to date with `rvm` and `brew`:

    `rvm list known` : Ref : [Rubies rvm knows about and can install](http://rvm.io/rubies/installing)

    The part I am most interested in this day June 2021 reads as:
    `...`
    `[ruby-]2.5[.9]`
    `[ruby-]2.6[.7]`
    `[ruby-]2.7[.3]`
    `[ruby-]3[.0.1]`
    The part I am most interested in this day in June 2021 reads as:
    ...
    `[ruby-]2.5[.9]`
    `[ruby-]2.6[.7]`
    `[ruby-]2.7[.3]`
    `[ruby-]3[.0.1]`
    `ruby-head`

    Which version of Ruby to use with which version of Rails ??
    @@ -86,9 +86,9 @@ Run ..

    `rvm gemset list`

    `gem install rails -v 5.0.0`
    `gem install rails -v 6.0.0`

    The global gemset now contains Ruby 2.6.5 with Rails 5.0.0
    The global gemset now contains Ruby 2.6.5 with Rails 6.0.0

    To better underdstand this process
    I refer you to these instructions:
    @@ -121,9 +121,9 @@ I have two branches, master and staging, perfect mirrors.
    I am in the staging branch.
    I make the new branch:

    `git checkout -b rails425`
    `git checkout -b rails526`

    Rails 4 to 5.
    Rails 5 to 6.

    Now ..

  5. kathyonu revised this gist Jun 23, 2021. 1 changed file with 36 additions and 55 deletions.
    91 changes: 36 additions & 55 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -13,14 +13,13 @@ Keep your system up to date with `rvm` and `brew`:

    `rvm list known` : Ref : [Rubies rvm knows about and can install](http://rvm.io/rubies/installing)

    The part you are most interested in this day in Feb 2020 reads as:

    `[ruby-]2.2[.7]`
    `[ruby-]2.4[.9]`
    `[ruby-]2.5[.7]`
    `[ruby-]2.6[.5]`
    `[ruby-]2.7[.0]`
    `ruby-head`
    The part I am most interested in this day June 2021 reads as:
    `...`
    `[ruby-]2.5[.9]`
    `[ruby-]2.6[.7]`
    `[ruby-]2.7[.3]`
    `[ruby-]3[.0.1]`
    `ruby-head`

    Which version of Ruby to use with which version of Rails ??
    [Rubygems Rails Versions](https://rubygems.org/gems/rails/versions)
    @@ -65,21 +64,21 @@ Verify with:

    Now we install Ruby ..

    `rvm install 2.6.5` : adjust to desired version.
    `rvm install 2.6.7` : adjust to desired version.

    Our @global gemset now contains Ruby 2.6.5.
    Our @global gemset now contains Ruby 2.6.7, a Heroku supported version.
    Both these commands are the same, run one:

    `rvm use ruby-2.6.5`
    `rvm use 2.6.5`
    `rvm use ruby-2.6.7`
    `rvm use 2.6.7`

    We have a new @global entity, Ruby 2.6.5,
    and it needs a few things to make it sing.
    If you want to use 2.6.7 from now on, use:

    If you want to use 2.6.5 from now on, use:
    `rvm --default use ruby-2.6.7`

    We have a new @global entity, Ruby 2.6.7,
    and it needs a few things to make it sing.

    `rvm --default use ruby-2.6.5`

    Now we install Rails into this new ruby container.

    We are in the `global` gemset. How do you know ??
    @@ -95,7 +94,7 @@ To better underdstand this process
    I refer you to these instructions:
    [Rails <=> Ruby Verisions](https://stackoverflow.com/questions/41957353/upgrading-ruby-version-and-rails-compatibility)

    Now we add into the Ruby 2.6.5 container its new bundler:
    Now we add into the Ruby 2.6.7 container its new bundler:

    `gem install bundler`

    @@ -130,16 +129,16 @@ Now ..

    `open -e Gemfile` : change Ruby and Rails version
    `open -e .ruby-version` : change Ruby version
    `open -e .ruby-gemset` : change to new gemset name
    `open -e .ruby-gemset` : change to new gemset name you create below

    We are still using global gemset.
    We now create new gemset for the app, for first time creation use:

    `rvm gemset use Rails5.0.0_your_app_name --create --default`
    `rvm gemset use Rails6.0.3_your_app_name --create --default`

    With above command used once, below is never needed:

    `rvm gemset use Rails4.2_app_name`
    `rvm gemset use Rails6.0.3_your_app_name`

    Run this command again, you will see the gemset is being used:

    @@ -157,11 +156,13 @@ the `.ruby-gemset` file will be used to set the correct gemset.

    You can use the command to change gemsets and change back:

    `rvm gemset use Rails5.0.0_app_name`
    `rvm gemset use Rails5.0.0_your_app_name`

    `rvm gemset use Rails6.0.3_your_app_name`

    To upgrade your rails version, install Rails wtih this:

    `gem install rails --version 5.0.0`
    `gem install rails --version 6.0.3`

    If all is well on rails response, skip down to

    @@ -186,15 +187,20 @@ Verify your app's gemset with:
    `rvm gemset list`

    Changing gemset will work if you are in wrong one.
    You want to be here: `Rails5.0.0_your_app_name`
    You want to be here: `Rails6.0.3_your_app_name`
    You get there by running this, anytime:

    `rvm gemset use Rails5.0.0_your_app_name`
    `rvm gemset use Rails6.0.3_your_app_name`

    Now run:

    `gem install rails`

    The response is:

    `Successfully installed rails-6.1.3.2`
    `1 gem installed`

    Now run:

    `bundle update rails`
    @@ -203,34 +209,9 @@ Now run:

    `bundle install`

    From study on upgrading from Rails 4 to Rails 5, I knew I would need these gems in my Gemfile, temporarily.

    `gem 'actionpack', '~> 5.0'` : [https://www.rubydoc.info/gems/actionpack/5.0.0](https://www.rubydoc.info/gems/actionpack/5.0.0)
    `gem 'actionview', '~> 5.0'` : [https://www.rubydoc.info/gems/actionview/5.0.0](https://www.rubydoc.info/gems/actionview/5.0.0)
    `gem 'activesupport', '~> 5.0'` : [https://www.rubydoc.info/gems/activesupport/5.0.0](https://www.rubydoc.info/gems/activesupport/5.0.0)
    `gem 'activemodel', '~> 5.0'` : [https://www.rubydoc.info/gems/activemodel/5.0.0](https://www.rubydoc.info/gems/activemodel/5.0.0)

    Upgrading from 4 to 5 requires more steps, more adjustments to the Gemfile.
    One thing I had to do to make this jump to Rails 5 was comment out some of the RSpec testing gems.
    They were not able to play well with Bundler.
    After I achieved Rails 5.1, I uncommented the gems I need.

    I used these resources, completing every action required before I ran the next command.

    [https://guides.rubyonrails.org/upgrading_ruby_on_rails.html](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html)

    [https://stackoverflow.com/questions/38442248/how-to-upgrade-from-rails-4-2-6-to-rails-5-0](https://stackoverflow.com/questions/38442248/how-to-upgrade-from-rails-4-2-6-to-rails-5-0)

    After you run:

    `bundle install`

    Now we update Rails and it is important to do this every time you upgrade Rails versions.

    The Rails 4 command was:
    `rake rails:update`

    The Rails 5 command is:
    The Rails command is:

    `rails app:update`

    @@ -269,11 +250,11 @@ updates-all-gems-command, if you have many gems outdated.
    `gem list` : shows you all gems in your new gemset

    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : Rails4.2_app_name
    Let us presume this is your first gemset ..
    We will create a good name for it : `Rails6.0.3_your_app_name`
    Yes, change the app_name to your app's name for easy reference.
    When you upgrade to Rails5.1 simply create a new gemset, and you
    can revert to the Rails5.1 gemset should the need arise.
    If you have an app that uses Rails5.1, you can revert to the Rails5.1
    gemset should the need arise.

    Your app is now ready to go.
    At any time you can do the steps above to keep your app humming.
  6. kathyonu revised this gist Mar 18, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -221,11 +221,11 @@ I used these resources, completing every action required before I ran the next c

    [https://stackoverflow.com/questions/38442248/how-to-upgrade-from-rails-4-2-6-to-rails-5-0](https://stackoverflow.com/questions/38442248/how-to-upgrade-from-rails-4-2-6-to-rails-5-0)

    Now run:
    After you run:

    `bundle install`

    Next we update Rails and it is important to do this every time you upgrade Rails versions.
    Now we update Rails and it is important to do this every time you upgrade Rails versions.

    The Rails 4 command was:
    `rake rails:update`
  7. kathyonu revised this gist Mar 17, 2020. 1 changed file with 12 additions and 5 deletions.
    17 changes: 12 additions & 5 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -203,17 +203,19 @@ Now run:

    `bundle install`

    From study on upgrading from Rails 4 to Rails 5, I knew I would need these gems in my Gemfile.
    From study on upgrading from Rails 4 to Rails 5, I knew I would need these gems in my Gemfile, temporarily.

    `gem 'actionpack', '~> 5.0'` : [https://www.rubydoc.info/gems/actionpack/5.0.0](https://www.rubydoc.info/gems/actionpack/5.0.0)
    `gem 'actionview', '~> 5.0'` : [https://www.rubydoc.info/gems/actionview/5.0.0](https://www.rubydoc.info/gems/actionview/5.0.0)
    `gem 'activesupport', '~> 5.0'` : [https://www.rubydoc.info/gems/activesupport/5.0.0](https://www.rubydoc.info/gems/activesupport/5.0.0)
    `gem 'activemodel', '~> 5.0'` : [https://www.rubydoc.info/gems/activemodel/5.0.0](https://www.rubydoc.info/gems/activemodel/5.0.0)

    Upgrading from 4 to 5 requires more steps, more adjustments to the Gemfile.
    I used these resources, completing every action required before I ran the next command.
    One thing I had to do to make this jump to Rails 5 was comment out some of the RSpec testing gems.
    They were not able to play well with Bundler.
    After I achieved Rails 5.1, I uncommented the gems I need.

    [https://guides.rubyonrails.org/upgrading_ruby_on_rails.html](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html)
    I used these resources, completing every action required before I ran the next command.

    [https://guides.rubyonrails.org/upgrading_ruby_on_rails.html](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html)

    @@ -225,7 +227,12 @@ Now run:

    Next we update Rails and it is important to do this every time you upgrade Rails versions.

    The Rails 4 command was:
    `rake rails:update`

    The Rails 5 command is:

    `rails app:update`

    If the process asks you if you want to overwrite a file, type in
    `d` for `diff` and it will show you the changes it is about to make.
    @@ -235,8 +242,8 @@ and make those additions by hand, save the file, close it,
    and choose `n` : do not allow the overwrite. That preserves your code and adds new.

    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.
    bin file overwrite question, after you type in `d` for `diff`, you will know what to do.
    Do not allow overwrite of spring codes in the bin/files if you need to make additions.

    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:
  8. kathyonu revised this gist Mar 16, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -205,9 +205,9 @@ Now run:

    From study on upgrading from Rails 4 to Rails 5, I knew I would need these gems in my Gemfile.

    `gem 'actionpack', '~> 5.0'` : [https://www.rubydoc.info/gems/actionpack/5.0.0](https://www.rubydoc.info/gems/actionpack/5.0.0)
    `gem 'actionview', '~> 5.0'` : [https://www.rubydoc.info/gems/actionview/5.0.0](https://www.rubydoc.info/gems/actionview/5.0.0)
    `gem 'activesupport', '~> 5.0'` : [https://www.rubydoc.info/gems/activesupport/5.0.0](https://www.rubydoc.info/gems/activesupport/5.0.0)
    `gem 'actionpack', '~> 5.0'` : [https://www.rubydoc.info/gems/actionpack/5.0.0](https://www.rubydoc.info/gems/actionpack/5.0.0)
    `gem 'actionview', '~> 5.0'` : [https://www.rubydoc.info/gems/actionview/5.0.0](https://www.rubydoc.info/gems/actionview/5.0.0)
    `gem 'activesupport', '~> 5.0'` : [https://www.rubydoc.info/gems/activesupport/5.0.0](https://www.rubydoc.info/gems/activesupport/5.0.0)
    `gem 'activemodel', '~> 5.0'` : [https://www.rubydoc.info/gems/activemodel/5.0.0](https://www.rubydoc.info/gems/activemodel/5.0.0)

    Upgrading from 4 to 5 requires more steps, more adjustments to the Gemfile.
  9. kathyonu revised this gist Mar 16, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -205,10 +205,10 @@ Now run:

    From study on upgrading from Rails 4 to Rails 5, I knew I would need these gems in my Gemfile.

    `gem 'actionpack', '~> 5.0'` : https://www.rubydoc.info/gems/actionpack/5.0.0
    `gem 'actionview', '~> 5.0'` : https://www.rubydoc.info/gems/actionview/5.0.0
    `gem 'activesupport', '~> 5.0'` : https://www.rubydoc.info/gems/activesupport/5.0.0
    `gem 'activemodel', '~> 5.0'` : https://www.rubydoc.info/gems/activemodel/5.0.0
    `gem 'actionpack', '~> 5.0'` : [https://www.rubydoc.info/gems/actionpack/5.0.0](https://www.rubydoc.info/gems/actionpack/5.0.0)
    `gem 'actionview', '~> 5.0'` : [https://www.rubydoc.info/gems/actionview/5.0.0](https://www.rubydoc.info/gems/actionview/5.0.0)
    `gem 'activesupport', '~> 5.0'` : [https://www.rubydoc.info/gems/activesupport/5.0.0](https://www.rubydoc.info/gems/activesupport/5.0.0)
    `gem 'activemodel', '~> 5.0'` : [https://www.rubydoc.info/gems/activemodel/5.0.0](https://www.rubydoc.info/gems/activemodel/5.0.0)

    Upgrading from 4 to 5 requires more steps, more adjustments to the Gemfile.
    I used these resources, completing every action required before I ran the next command.
  10. kathyonu revised this gist Mar 16, 2020. 1 changed file with 12 additions and 10 deletions.
    22 changes: 12 additions & 10 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -101,18 +101,24 @@ Now we add into the Ruby 2.6.5 container its new bundler:

    Take a breath before we change into you app's directory.
    We are going to be making changes to add the new Ruby and Rails
    to our app.
    Before we do that, I will make a new feature branch:

    First, Change Directory the app ..
    to the app.

    Change Directory the app ..

    `cd your_application_name`
    `rvm gemset list` : still on => global
    `git branch`
    `rvm gemset list` : still on => global

    Now, I will make a new feature branch, and the reason is,
    upgrading from Rails 4 to Rails 5 is a difficult leap, entailing many
    changes.

    The `git branch` command will show you where you are.
    I have two branches, master and staging, perfect mirrors.

    `git branch`
    master
    * staging

    I am in the staging branch.
    I make the new branch:

    @@ -126,10 +132,6 @@ Now ..
    `open -e .ruby-version` : change Ruby version
    `open -e .ruby-gemset` : change to new gemset name

    You create that name after you make certain you are

    `rvm use 2.5.7` : sets Terminal to 2.5.7 immediately

    We are still using global gemset.
    We now create new gemset for the app, for first time creation use:

  11. kathyonu revised this gist Mar 15, 2020. 1 changed file with 84 additions and 38 deletions.
    122 changes: 84 additions & 38 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    You will see you are using the (default) gemset.
    Keep your system up to date with `rvm` and `brew`:

    `rvm get stable`
    `rvm get head`
    `brew update` : will update your Homebrew (takes a while):
    `brew doctor` : check to make sure all is well

    @@ -65,43 +65,76 @@ Verify with:

    Now we install Ruby ..

    `rvm install 2.5.7` : adjust versions as needed if Gist not current to latest Ruby or Rails versions.
    `rvm use ruby-2.5.7` : a new entity, needs a few things to work ..
    or ..
    `rvm --default use ruby-2.5.7` *: if you want to use 2.5.7 from now on.
    `rvm install 2.6.5` : adjust to desired version.

    Our @global gemset now contains Ruby 2.6.5.
    Both these commands are the same, run one:

    `rvm use ruby-2.6.5`
    `rvm use 2.6.5`

    We have a new @global entity, Ruby 2.6.5,
    and it needs a few things to make it sing.

    If you want to use 2.6.5 from now on, use:

    `rvm --default use ruby-2.6.5`

    Now we install rails into the new entity, the new ruby container.
    Now we install Rails into this new ruby container.

    We are in the `global` gemset. How do you know ??
    Run ..

    `rvm gemset list`

    `gem install rails -v 4.2.11.1` : now Ruby 2.5.7 has Rails 4.2.11.1
    `gem install rails -v 5.0.0`

    To better underdstand this process, I referred to these instructions:
    The global gemset now contains Ruby 2.6.5 with Rails 5.0.0

    To better underdstand this process
    I refer you to these instructions:
    [Rails <=> Ruby Verisions](https://stackoverflow.com/questions/41957353/upgrading-ruby-version-and-rails-compatibility)

    Now we add into the Ruby 2.5.7 container its new bundler:
    Now we add into the Ruby 2.6.5 container its new bundler:

    `gem install bundler`

    Now we Change Directory into your app ..
    Take a breath before we change into you app's directory.
    We are going to be making changes to add the new Ruby and Rails
    to our app.
    Before we do that, I will make a new feature branch:

    First, Change Directory the app ..

    `cd your_application_name`
    `rvm gemset list` : still on => global
    `rvm gemset list` : still on => global
    `git branch`

    The `git branch` command will show you where you are.
    I have two branches, master and staging, perfect mirrors.

    I am in the staging branch.
    I make the new branch:

    `git checkout -b rails425`

    Rails 4 to 5.

    Now ..

    `open -e Gemfile` : change Ruby version
    `open -e Gemfile` : change Ruby and Rails version
    `open -e .ruby-version` : change Ruby version
    `open -e .ruby-gemset` : change Ruby version
    `open -e .ruby-gemset` : change to new gemset name

    You create that name after you make certain you are

    `rvm use 2.5.7` : sets Terminal to 2.5.7 immediately

    We are still using global gemset.
    We now create new gemset for the app, for first time creation use:

    `rvm gemset use Rails4.2_your_app_name --create --default`

    `rvm gemset use Rails5.0.0_your_app_name --create --default`
    With above command used once, below is never needed:

    `rvm gemset use Rails4.2_app_name`
    @@ -122,25 +155,19 @@ the `.ruby-gemset` file will be used to set the correct gemset.

    You can use the command to change gemsets and change back:

    `rvm gemset use Rails4.2_app_name`
    `rvm gemset use Rails5.0.0_app_name`

    To upgrade your rails version, do this:

    `open -e Gemfile` : Change Rails version to upgrade version
    `gem install rails --version 4.2.11.1`

    Continuing, no matter your Rails version or gem install:

    `ruby -v`
    `rails -v`
    To upgrade your rails version, install Rails wtih this:

    `gem install rails --version 5.0.0`

    If all is well on rails response, skip down to
    If all is well on rails response, skip down to

    `bundle update rails`
    `bundle update rails` below.

    otherwise do this:
    Otherwise do this:

    `open -e Gemfile` : to change Rails version to 4.2.11.1 then run
    `open -e Gemfile` : to change Rails version to new version then run

    `gem install rails` : If all is not well, check your gemset with:

    @@ -157,27 +184,47 @@ Verify your app's gemset with:
    `rvm gemset list`

    Changing gemset will work if you are in wrong one.
    You want to be here: `Rails4.2_your_app_name`
    You want to be here: `Rails5.0.0_your_app_name`
    You get there by running this, anytime:

    `rvm gemset use Rails4.2_app_name`
    `rvm gemset use Rails5.0.0_your_app_name`

    Now run:
    Now run:

    `gem install rails`

    Now run this:
    Now run:

    `bundle update rails`

    Now run:
    Now run:

    `bundle install`


    From study on upgrading from Rails 4 to Rails 5, I knew I would need these gems in my Gemfile.

    `gem 'actionpack', '~> 5.0'` : https://www.rubydoc.info/gems/actionpack/5.0.0
    `gem 'actionview', '~> 5.0'` : https://www.rubydoc.info/gems/actionview/5.0.0
    `gem 'activesupport', '~> 5.0'` : https://www.rubydoc.info/gems/activesupport/5.0.0
    `gem 'activemodel', '~> 5.0'` : https://www.rubydoc.info/gems/activemodel/5.0.0

    Upgrading from 4 to 5 requires more steps, more adjustments to the Gemfile.
    I used these resources, completing every action required before I ran the next command.

    [https://guides.rubyonrails.org/upgrading_ruby_on_rails.html](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html)

    [https://guides.rubyonrails.org/upgrading_ruby_on_rails.html](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html)

    [https://stackoverflow.com/questions/38442248/how-to-upgrade-from-rails-4-2-6-to-rails-5-0](https://stackoverflow.com/questions/38442248/how-to-upgrade-from-rails-4-2-6-to-rails-5-0)

    Now run:

    `bundle install`

    Next we update Rails and it is important to do this every time you upgrade Rails versions.

    `rake rails:update`

    If the process asks you if you want to overwrite a file, type in
    `d` for `diff` and it will show you the changes it is about to make.
    If you have working code in your file that cannot be overwritten,
    @@ -188,8 +235,7 @@ and choose `n` : do not allow the overwrite. That preserves your code and adds
    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.



    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:

  12. kathyonu revised this gist Feb 9, 2020. 1 changed file with 27 additions and 28 deletions.
    55 changes: 27 additions & 28 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ EXAMPLE:
    Because we are in the => global gemset, I always do the gem update.
    Verify with:

    `rvm list known`
    `rvm gemset list`
    `gem update` : updates only the global gemset gems

    Now we install Ruby ..
    @@ -86,23 +86,6 @@ Now we add into the Ruby 2.5.7 container its new bundler:

    `gem install bundler`

    `bundle install` : to install all other Ruby version project gems

    Next we update Rails and it is important to do this every time you upgrade Rails versions.

    `rake rails:update`

    If the process asks you if you want to overwrite a file, type in
    `d` for `diff` and it will show you the changes it is about to make.
    If you have working code in your file that cannot be overwritten,
    and yet there is new code to be added, simply open the file it wants to overwrite,
    and make those additions by hand, save the file, close it,
    and choose `n` : do not allow the overwrite. That preserves your code and adds new.

    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.

    Now we Change Directory into your app ..

    `cd your_application_name`
    @@ -191,22 +174,38 @@ You get there by running this, anytime:

    `bundle install`

    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:
    Next we update Rails and it is important to do this every time you upgrade Rails versions.

    `rake rails:update`

    If the process asks you if you want to overwrite a file, type in
    `d` for `diff` and it will show you the changes it is about to make.
    If you have working code in your file that cannot be overwritten,
    and yet there is new code to be added, simply open the file it wants to overwrite,
    and make those additions by hand, save the file, close it,
    and choose `n` : do not allow the overwrite. That preserves your code and adds new.

    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.


    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:

    `bundle outdated`

    Next command is not a safe one, possibly updating many gems,
    changing many things:
    Next command is not a safe one, possibly updating many gems,
    changing many things:

    See A VALID NOTE above, and note here below before running `bundle update`
    See A VALID NOTE above, and note here below before running `bundle update`

    Run `bundle outdated` before you blindly run the following update command.
    You can see how many gems will be updated if all are done with one command.
    You can update gems one by one with `bundle update gem_name`
    Run `bundle outdated` before you blindly run the following update command.
    You can see how many gems will be updated if all are done with one command.
    You can update gems one by one with `bundle update gem_name`

    Recommend you do a `git commit` command before you run this
    updates-all-gems-command, if you have many gems outdated.
    Recommend you do a `git commit` command before you run this
    updates-all-gems-command, if you have many gems outdated.

    `bundle update`

  13. kathyonu revised this gist Feb 9, 2020. 1 changed file with 4 additions and 8 deletions.
    12 changes: 4 additions & 8 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -33,8 +33,8 @@ upgrading command comes later, make no change to ruby yet.

    Run these:

    `rvm gemset list` : should be on global.
    `rvm gemset use global` : if you are somehow out of the => global gemset.
    `rvm gemset list` : we want to use global
    `rvm gemset use global`
    `gem update --system`
    `gem update rake`
    `gem update bundler`
    @@ -123,13 +123,9 @@ With above command used once, below is never needed:

    `rvm gemset use Rails4.2_app_name`

    For the first time use, we will add the create and default switches.

    `rvm gemset use Rails4.2 _app_name --create --default`

    Run this command again, you will see the gemset is being used:

    `rvm gemset list`
    `rvm gemset list`

    You just created and are now using the application's gemset.
    The `--default` switch will cause this gemset to be used when
    @@ -193,7 +189,7 @@ You get there by running this, anytime:

    Now run:

    `bundle_install`
    `bundle install`

    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:
  14. kathyonu revised this gist Feb 6, 2020. 1 changed file with 26 additions and 22 deletions.
    48 changes: 26 additions & 22 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -8,10 +8,10 @@ You will see you are using the (default) gemset.
    Keep your system up to date with `rvm` and `brew`:

    `rvm get stable`
    `brew update` : will update your Homebrew (takes a while):
    `brew update` : will update your Homebrew (takes a while):
    `brew doctor` : check to make sure all is well

    `rvm list known` [Rubies rvm knows about and can install](http://rvm.io/rubies/installing)
    `rvm list known` : Ref : [Rubies rvm knows about and can install](http://rvm.io/rubies/installing)

    The part you are most interested in this day in Feb 2020 reads as:

    @@ -42,7 +42,7 @@ Run these:
    `gem outdated`

    A VALID NOTE from [stackoverflow](http://stackoverflow.com/questions/28941173/unable-to-obtain-stable-firefox-connection-in-60-seconds-127-0-0-17055)
    "don't ever use 'bundle update' or 'gem update' arbitrarily. That's like saying
    "Don't ever use 'bundle update' or 'gem update' arbitrarily. That's like saying
    "give me the newest versions of all gems from all available sources" without knowing
    the effects beforehand. It can be a Pandora's Box of trouble if you aren't careful,
    especially 'bundle update'."
    @@ -70,12 +70,12 @@ Now we install Ruby ..
    or ..
    `rvm --default use ruby-2.5.7` *: if you want to use 2.5.7 from now on.

    Now we install rails into the new entity, the new ruby container.
    Now we install rails into the new entity, the new ruby container.

    We are in the `global` gemset. How do you know ??
    Run ..
    We are in the `global` gemset. How do you know ??
    Run ..

    `rvm gemset list'
    `rvm gemset list`

    `gem install rails -v 4.2.11.1` : now Ruby 2.5.7 has Rails 4.2.11.1

    @@ -114,9 +114,6 @@ Now we Change Directory into your app ..

    `rvm use 2.5.7` : sets Terminal to 2.5.7 immediately

    Did you know FIXNUM and BIGNUM are aliases for INTEGER in the upgrade to Ruby 2.4.1, see:
    [Behavior Changes in Ruby 2.4](https://wyeworks.com/blog/2016/6/22/behavior-changes-in-ruby-2.4)

    We are still using global gemset.
    We now create new gemset for the app, for first time creation use:

    @@ -130,7 +127,7 @@ For the first time use, we will add the create and default switches.

    `rvm gemset use Rails4.2 _app_name --create --default`

    Run thhis command again, you will see the gemset is being used:
    Run this command again, you will see the gemset is being used:

    `rvm gemset list`

    @@ -148,7 +145,8 @@ You can use the command to change gemsets and change back:

    `rvm gemset use Rails4.2_app_name`

    To upgrade your rails version, do this
    To upgrade your rails version, do this:

    `open -e Gemfile` : Change Rails version to upgrade version
    `gem install rails --version 4.2.11.1`

    @@ -169,7 +167,7 @@ Continuing, no matter your Rails version or gem install:

    `rvm gemset list` : decipher the terminal response.

    If you see an error such as:
    If you see an error such as:
    `Ignoring executable-hooks-1.3.2 because its extensions are not built.`
    `Try: gem pristine executable-hooks --version x.x.x`

    @@ -179,9 +177,9 @@ Verify your app's gemset with:

    `rvm gemset list`

    Changing gemset will work if you are in wrong one.
    You want to be here: `Rails4.2_your_app_name`
    You get there by running this, anytime:
    Changing gemset will work if you are in wrong one.
    You want to be here: `Rails4.2_your_app_name`
    You get there by running this, anytime:

    `rvm gemset use Rails4.2_app_name`

    @@ -197,17 +195,18 @@ Verify your app's gemset with:

    `bundle_install`

    Now, do we have any outdated gems ?
    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:

    `bundle outdated`

    Next command is not a safe one, possibly updating many gems, changing many things:
    Next command is not a safe one, possibly updating many gems,
    changing many things:

    See A VALID NOTE above, and note here below before running `bundle update`

    Run `bundle outdated` before you blindly run the following update command.
    You can see how many gems will be updated if all are done with one command.
    Run `bundle outdated` before you blindly run the following update command.
    You can see how many gems will be updated if all are done with one command.
    You can update gems one by one with `bundle update gem_name`

    Recommend you do a `git commit` command before you run this
    @@ -247,7 +246,7 @@ If you ever lose track of where you are, commands wise, just type into your Term

    Your app is now updated, Ruby, Rails and gems wise.
    Welcome to the your working versions of Ruby on Rails.
    Three cheers for your Rails app's health.
    Your Rails app's health brought to you by
    - [This Gister](https://github.com/kathyonu)

    This list draws heavily upon my learnings with [RailsApps Tutorials](https://tutorials.railsapps.org/).
    @@ -256,4 +255,9 @@ If you are looking for a Ruby on Rails Tutorial, go RailsApps,
    where you can truly begin at the beginning and learn your way to
    deploy with confidence. We did.

    Address of __This Rails Applications Health Codes Gist__ is : https://gist.github.com/kathyonu/c9ef8190e50422bc0edc
    Did you know FIXNUM and BIGNUM are aliases for INTEGER in the upgrade to Ruby 2.4.1.
    See:
    [Behavior Changes in Ruby 2.4](https://wyeworks.com/blog/2016/6/22/behavior-changes-in-ruby-2.4)

    Address of __This Rails Applications Health Codes Gist__ is :
    https://gist.github.com/kathyonu/c9ef8190e50422bc0edc
  15. kathyonu revised this gist Feb 6, 2020. 1 changed file with 20 additions and 20 deletions.
    40 changes: 20 additions & 20 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -23,18 +23,18 @@ The part you are most interested in this day in Feb 2020 reads as:
    `ruby-head`

    Which version of Ruby to use with which version of Rails ??
    [Rubygems](https://rubygems.org/gems/rails/versions)
    [Rubygems Rails Versions](https://rubygems.org/gems/rails/versions)
    Click on your version, and check its requirements.

    Now, check your ruby version, just so you know,
    upgrading command comes later, make no change to ruby yet.

    `ruby -v` : My current ruby 2.5.5p157
    `ruby -v`

    Run these:

    `rvm gemset list` : should be on global.
    `rvm gemset use global` : if you are somehow out of the => global gemset.
    `rvm gemset list` : should be on global.
    `rvm gemset use global` : if you are somehow out of the => global gemset.
    `gem update --system`
    `gem update rake`
    `gem update bundler`
    @@ -52,11 +52,13 @@ This method lets you easily check each Gem's upgrades as you go along, and preve
    your being overwhelmed with breaks in your app. When you have tests in place covering
    your code, finding the causes of those breaks becomes easy peasy lemon squeezey.

    EXAMPLE:
    `bundle update selenium-webdriver` : and then run your tests, to check.
    EXAMPLE:

    `bundle update selenium-webdriver` : and then run your tests, to check.
    `bundle update launchy` : and then run tests that use Launchy, to check.

    Because we are in the => global gemset, I always do the gem update. Verify with:
    Because we are in the => global gemset, I always do the gem update.
    Verify with:

    `rvm list known`
    `gem update` : updates only the global gemset gems
    @@ -66,11 +68,12 @@ Now we install Ruby ..
    `rvm install 2.5.7` : adjust versions as needed if Gist not current to latest Ruby or Rails versions.
    `rvm use ruby-2.5.7` : a new entity, needs a few things to work ..
    or ..
    `rvm --default use ruby-2.5.7` if you want to use 2.5.7 from now on.
    `rvm --default use ruby-2.5.7` *: if you want to use 2.5.7 from now on.

    Now we install rails into the new entity, the new ruby container.

    We are in the `global` gemset. How do you know ?? Run ..
    We are in the `global` gemset. How do you know ??
    Run ..

    `rvm gemset list'

    @@ -100,10 +103,6 @@ An example is if you are using the Spring gem, you will see codes with /spring/
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.

    Now is a good time to update your bundled gems.

    `bundle outdated` : will show you all outdated gems in the gemset you are using.

    Now we Change Directory into your app ..

    `cd your_application_name`
    @@ -196,8 +195,8 @@ Verify your app's gemset with:

    Now run:

    `bundle_install` and it should be clean through up to date, no additions or changes.

    `bundle_install`
    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:

    @@ -212,7 +211,7 @@ Verify your app's gemset with:
    You can update gems one by one with `bundle update gem_name`

    Recommend you do a `git commit` command before you run this
    updates-all-gems-command, IF you have many gems outdated.
    updates-all-gems-command, if you have many gems outdated.

    `bundle update`

    @@ -237,15 +236,14 @@ As needed to be current, make appropriate changes here:

    Fire it up with:

    `rails s`
    `rails s`

    If you ever lose track of where you are, commands wise, just type into your Terminal:

    `history`
    `history -10`
    `history -50`

    `pwd` print working directory to see where you are
    `pwd` print working directory to see where you are

    Your app is now updated, Ruby, Rails and gems wise.
    Welcome to the your working versions of Ruby on Rails.
    @@ -254,6 +252,8 @@ Three cheers for your Rails app's health.

    This list draws heavily upon my learnings with [RailsApps Tutorials](https://tutorials.railsapps.org/).

    If you are looking for a Ruby on Rails Tutorial, go RailsApps, where you can truly begin at the beginning and learn your way to deploy with confidence. We did.
    If you are looking for a Ruby on Rails Tutorial, go RailsApps,
    where you can truly begin at the beginning and learn your way to
    deploy with confidence. We did.

    Address of __This Rails Applications Health Codes Gist__ is : https://gist.github.com/kathyonu/c9ef8190e50422bc0edc
  16. kathyonu revised this gist Feb 6, 2020. 1 changed file with 138 additions and 293 deletions.
    431 changes: 138 additions & 293 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    *Commands to keep your app healthy, Ruby and Rails gems wise.*
    *Each command is described further below.*

    *Open new Terminal, note the gemsets showing:*

    `rvm gemset list`
    @@ -8,23 +8,33 @@ You will see you are using the (default) gemset.
    Keep your system up to date with `rvm` and `brew`:

    `rvm get stable`
    `brew update`
    `brew doctor`
    `rvm list known`
    `brew update` : will update your Homebrew (takes a while):
    `brew doctor` : check to make sure all is well

    `rvm list known` [Rubies rvm knows about and can install](http://rvm.io/rubies/installing)

    The part you are most interested in this day of 20170924 reads as:
    The part you are most interested in this day in Feb 2020 reads as:

    `[ruby-]2.2[.7]`
    `[ruby-]2.3[.4]`
    `[ruby-]2.4[.1]`
    `[ruby-]2.4[.9]`
    `[ruby-]2.5[.7]`
    `[ruby-]2.6[.5]`
    `[ruby-]2.7[.0]`
    `ruby-head`


    Which version of Ruby to use with which version of Rails ??
    [Rubygems](https://rubygems.org/gems/rails/versions)
    Click on your version, and check its requirements.

    Now, check your ruby version, just so you know,
    upgrading command comes later, make no change at this point.
    upgrading command comes later, make no change to ruby yet.

    `ruby -v`
    `rvm gemset list`
    `rvm gemset use global`
    `ruby -v` : My current ruby 2.5.5p157

    Run these:

    `rvm gemset list` : should be on global.
    `rvm gemset use global` : if you are somehow out of the => global gemset.
    `gem update --system`
    `gem update rake`
    `gem update bundler`
    @@ -42,41 +52,106 @@ This method lets you easily check each Gem's upgrades as you go along, and preve
    your being overwhelmed with breaks in your app. When you have tests in place covering
    your code, finding the causes of those breaks becomes easy peasy lemon squeezey.

    EXAMPLE: `bundle update selenium-webdriver` and then run your tests, to check.
    EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.
    EXAMPLE:
    `bundle update selenium-webdriver` : and then run your tests, to check.
    `bundle update launchy` : and then run tests that use Launchy, to check.

    Because we are in the => global gemset, I always do the gem update. Verify with:

    `gem update`
    `rvm list known`
    `rvm install 2.4.1` : adjust versions as needed if Gist not current to latest Ruby or Rails versions.
    `gem update` : updates only the global gemset gems

    Now we install Ruby ..

    `rvm install 2.5.7` : adjust versions as needed if Gist not current to latest Ruby or Rails versions.
    `rvm use ruby-2.5.7` : a new entity, needs a few things to work ..
    or ..
    `rvm --default use ruby-2.5.7` if you want to use 2.5.7 from now on.

    Now we install rails into the new entity, the new ruby container.

    We are in the `global` gemset. How do you know ?? Run ..

    `rvm gemset list'

    `gem install rails -v 4.2.11.1` : now Ruby 2.5.7 has Rails 4.2.11.1

    To better underdstand this process, I referred to these instructions:
    [Rails <=> Ruby Verisions](https://stackoverflow.com/questions/41957353/upgrading-ruby-version-and-rails-compatibility)

    Now we add into the Ruby 2.5.7 container its new bundler:

    `gem install bundler`

    `bundle install` : to install all other Ruby version project gems

    Next we update Rails and it is important to do this every time you upgrade Rails versions.

    `rake rails:update`

    If the process asks you if you want to overwrite a file, type in
    `d` for `diff` and it will show you the changes it is about to make.
    If you have working code in your file that cannot be overwritten,
    and yet there is new code to be added, simply open the file it wants to overwrite,
    and make those additions by hand, save the file, close it,
    and choose `n` : do not allow the overwrite. That preserves your code and adds new.

    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.

    `pwd` : check where you are any time you wish.
    Now is a good time to update your bundled gems.

    `bundle outdated` : will show you all outdated gems in the gemset you are using.

    Now we Change Directory into your app ..

    `cd your_application_name`
    `rvm gemset list`
    `open -e Gemfile` *: change Ruby version*
    `open -e .ruby-version` *: change Ruby version*
    `open -e .ruby-gemset` *: change Ruby version*
    `rvm use 2.4.1`
    `rvm gemset list` : still on => global

    `open -e Gemfile` : change Ruby version
    `open -e .ruby-version` : change Ruby version
    `open -e .ruby-gemset` : change Ruby version

    Before you upgrade to Ruby 2.4.1, see:
    `rvm use 2.5.7` : sets Terminal to 2.5.7 immediately

    Did you know FIXNUM and BIGNUM are aliases for INTEGER in the upgrade to Ruby 2.4.1, see:
    [Behavior Changes in Ruby 2.4](https://wyeworks.com/blog/2016/6/22/behavior-changes-in-ruby-2.4)

    We are still using global gemset, so now we create
    new gemset for the app for first time creation use:
    We are still using global gemset.
    We now create new gemset for the app, for first time creation use:

    `rvm gemset use Rails4.2_your_app_name --create --default`

    With above command used once, below is never needed:

    `rvm gemset use Rails4.2_app_name`

    Normal useage commands:
    `rvm gemset list`
    `rvm gemset use Rails4.2_your_app_name`
    `ruby -v`
    `rails -v`
    *To upgrade your rails version, do this:*
    `open -e Gemfile` : *Change Rails version to upgrade*
    `gem install rails --version 4.2.10`
    For the first time use, we will add the create and default switches.

    `rvm gemset use Rails4.2 _app_name --create --default`

    Run thhis command again, you will see the gemset is being used:

    `rvm gemset list`

    You just created and are now using the application's gemset.
    The `--default` switch will cause this gemset to be used when
    you first enter the app directory. At this point, I personally
    like to close that terminal window and open a new one, and watch
    the rvm magic show itself as it recognizes the new gemset.

    If you ever change gemsets, the `use` command is the way back.
    However, at this point, when you change directory into this app,
    the `.ruby-gemset` file will be used to set the correct gemset.

    You can use the command to change gemsets and change back:

    `rvm gemset use Rails4.2_app_name`

    To upgrade your rails version, do this
    `open -e Gemfile` : Change Rails version to upgrade version
    `gem install rails --version 4.2.11.1`

    Continuing, no matter your Rails version or gem install:

    @@ -89,7 +164,7 @@ Continuing, no matter your Rails version or gem install:

    otherwise do this:

    `open -e Gemfile` : to change Rails version to 4.2.10, then run
    `open -e Gemfile` : to change Rails version to 4.2.11.1 then run

    `gem install rails` : If all is not well, check your gemset with:

    @@ -99,29 +174,30 @@ Continuing, no matter your Rails version or gem install:
    `Ignoring executable-hooks-1.3.2 because its extensions are not built.`
    `Try: gem pristine executable-hooks --version x.x.x`

    Do not do the Try suggestion.
    DO NOT DO the Try suggestion.
    It means you are in the default or global gemset or you have a brand new gemset.
    Verify your app's gemset with:

    `rvm gemset list`

    Changing gemset will work if you are in wrong one, or ..
    With new gemset selected, run:
    Changing gemset will work if you are in wrong one.
    You want to be here: `Rails4.2_your_app_name`
    You get there by running this, anytime:

    `gem install rails`

    NOW, you can run this one:
    `rvm gemset use Rails4.2_app_name`

    `bundle update rails`
    Now run:

    If you ever lose track of where you are, commands wise, just type into your Terminal:
    `gem install rails`

    `history`
    Now run this:

    Now, run `bundle_install` and it should be clean through up to date, no additions or changes:
    `bundle update rails`

    `bundle install`
    Now run:

    `bundle_install` and it should be clean through up to date, no additions or changes.

    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:

    @@ -138,276 +214,45 @@ Verify your app's gemset with:
    Recommend you do a `git commit` command before you run this
    updates-all-gems-command, IF you have many gems outdated.

    `bundle update`
    `ruby -v`

    Returns : ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
    `bundle update`

    `ruby -v`
    `rails -v`
    `Rails 4.2.10`

    `gem list`

    Before you push to production, check your Gemfile.lock for vulnerabilites:
    [Is It Vulnerable ?](https://isitvulnerable.com/)

    ### Explanations :

    rvm get stable : updates your rvm:

    `rvm get stable`

    brew update : will update your Homebrew (takes a while):

    **#rvm list known** will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.
    `rvm list known`

    brew doctor : will tell you all is well with your Homebrew (takes a while):

    `brew doctor`

    Check your Ruby version. Expect version to be 2.4.1 or later:
    > `ruby -v`
    Check your Rails version. Expect version to be 4.2.10 or 5.0 or later:
    > `rails -v`
    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : **Rails4.2_app_name**
    Yes, change the _app_name to your app's name for easy reference.
    For the first time use, we will add the create and default switches.
    > `rvm gemset use ruby-2.4.1@rails4.2_app_name --create --default`
    rvm list known : will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.

    `rvm list known`

    pwd : will show you what directory you are in:

    `pwd`

    Change into your working directory:

    `cd your-application-name`

    Check your Ruby version. Expect version to be 2.4.1 or later:

    `ruby -v`

    Check your Rails version. Expect version to be 4.2.10 or later:
    `rails -v`
    `gem list` : shows you all gems in your new gemset

    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : Rails4.2_app_name
    Yes, change the app_name to your app's name for easy reference.
    When you upgrade to Rails5.1 simply create a new gemset, and you
    can revert to the Rails5.1 gemset should the need arise.

    For the first time use, we will add the create and default switches.

    `rvm gemset use Rails4.2 _app_name --create --default`

    Run thhis command again, you will see the gemset is being used:

    `rvm gemset list`

    You just created and are now using the application's gemset.
    The `--default` switch will cause this gemset to be used when
    you first enter the app directory. At this point, I personally
    like to close that terminal window and open a new one, and watch
    the rvm magic show itself as it recognizes the new gemset.

    If you ever change gemsets, the `use` command is the way back.
    However, at this point, when you change directory into this app,
    the `.ruby-gemset` file will be used to set the correct gemset.

    You can use the command to change gemsets and change back:

    > `rvm gemset use Rails4.2_app_name`
    or, if you are already using Rails 5 ..

    > `rvm gemset use Rails5_app_name`
    can revert to the Rails5.1 gemset should the need arise.

    Your app is now ready to go.
    At any time you can do the steps above to keep your app humming.

    As needed to be current, make appropriate changes here:
    > `open -e .ruby-gemset`
    > `open -e .ruby-version`
    > `bundle install`
    Before you push to production, check your Gemfile.lock for vulnerabilites:
    [Is It Vulnerable ?](https://isitvulnerable.com/)
    `open -e .ruby-gemset`
    `open -e .ruby-version`
    `bundle install`

    Fire it up with:

    `rails s`

    ### INSTRUCTIONS :

    Use the global gemset for this part.

    `rvm gemset list`

    You can now see the global gemset exists, now we use it.

    `rvm gemset use global`

    You are now using the global gemset, run the list command again,
    you will see it is so.

    `rvm gemset list`

    #### Now we begin the updates :

    gem update --system : does what it says, updates your system

    `gem update --system`

    gem update rake : does what it says, updates your rake gem
    `gem update rake`

    gem update bundler : does what it says, updates your bundler gem
    `gem update bundler`

    gem update rubygems-bundler : updates your rubygems-bundler gem
    `gem update rubygems-bundler`

    gem outdated : checks global gemset for out of date gems
    `gem outdated`

    See A VALID NOTE above.

    gem update : will update the global gemset

    `gem update`

    Update work is now complete using the global gemset.
    Next step is to make sure you are in your working directory ..

    pwd : will show you what directory you are in.

    `pwd`

    Change into your app directory.

    `cd my_application_name`

    Now, we look for and change to the gemset the application is using.

    `rvm gemset list`

    *Choose your correct gemset for your app, if you have more than one.*
    *If that gemset does not exist in the list, what i do is this :*
    *Make sure the Gemfile shows Ruby at 2.4.1*
    *Make sure the .ruby-version file shows 2.4.1*
    *You can use the `open -e file-address` command at the terminal_prompt.*

    `open -e Gemfile` : add the current version of Rails, we are using 4.2.10
    `open -e .ruby-version` : currently it reads as 2.4.1p111
    `open -e .ruby-gemset` : currently reads as Rails-4_2_app_name

    Make sure the `.ruby-gemset` file reads as your real `app-gemset-name` .
    That means the only thing in the .ruby-gemset file should be, Rails-4_2_app_name

    ruby -v : will respond with your Ruby version.

    `ruby -v`

    *If the response is not 2.4.1, tell rvm to use Ruby-2.4.1*
    `rvm use 2.4.1`
    If you ever lose track of where you are, commands wise, just type into your Terminal:

    *If the response is not, **You are now using Ruby 2.4.1**, run
    **#rvm list known** to show you what rubies rvm knows about.*
    `rvm list known`
    `history`
    `history -10`
    `history -50`

    *If the 2.4.1 Ruby is not showing, run this lovely command.*
    `rvm install 2.4.1`

    *Watch for rvm install instructions, if any, and use them.*
    *Voila, you are now on Ruby 2.4.1 and yes, it is that easy.*
    *Now that you are using 2.4.1 we can create the gemset. *

    `rvm gemset use Rails4.2_app_name --create --default`

    At this point, I personally like to close that terminal window
    and open a new one, and watch the rvm magic show itself as it
    recognizes the new gemset, if this is the first time you set it.

    If you ever change gemsets, this is the way back.
    (However, at this point, when you change directory into this app,
    the .ruby-gemset file will be used to set the correct gemset.)

    `rvm gemset use Rails5.1_app_name`

    Check your Ruby version. Expect version to be 2.4.1

    *Check your Ruby version. Expect version to be 2.4.1*
    `ruby -v`

    *Check your Rails version. Expect version to be 4.2.10*
    `rails -v`

    *If you are not yet using Rails4.2.10, this is the command to install:*
    `gem install rails`

    Notice it is not, `bundle install` here, we used `gem install`.
    Make sure you do not skip this next step.

    `bundle update rails`

    `bundle install`

    It should be a clean response with no additions or changes.
    If you have difficulties here, trash your Gemfile.lock file, then run this command again.

    `bundle install`

    Next we update Rails and it is important to do this every time you upgrade Rails versions.

    `rake rails:update`

    If the process asks you if you want to overwrite a file, type in
    `d` for `diff` and it will show you the changes it is about to make.
    If you have working code in your file that cannot be overwritten,
    and yet there is new code to be added, simply open the file it wants to overwrite,
    and make those additions by hand, save the file, close it,
    and choose `n` : do not allow the overwrite. That preserves your code and adds new.

    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.

    Now is a good time to update your bundled gems.*
    bundle outdated : will show you all outdated gems in the gemset you are using.

    `bundle outdated`

    See A VALID NOTE above.

    bundle update : will will update your gems.

    `bundle update`

    Bundler now does its magic.
    Follow any instructions bundler gives you while it updates.

    *Now check your Rails version, it should read 4.2.10 *
    `rails -v`

    *Your Ruby version should read as 2.4.1 *
    `ruby -v`
    `pwd` print working directory to see where you are

    Your app is now updated, Ruby, Rails and gems wise
    Welcome to the Nearest Edge of Ruby on Rails
    Three cheers for your Rails app's health - [This Gister](https://github.com/kathyonu)
    Your app is now updated, Ruby, Rails and gems wise.
    Welcome to the your working versions of Ruby on Rails.
    Three cheers for your Rails app's health.
    - [This Gister](https://github.com/kathyonu)

    This list draws heavily upon my learnings with [RailsApps Tutorials](https://tutorials.railsapps.org/), specifically [Updating to Rails 4.2](http://railsapps.github.io/updating-rails.html).
    This list draws heavily upon my learnings with [RailsApps Tutorials](https://tutorials.railsapps.org/).

    If you are looking for a Ruby on Rails Tutorial, go RailsApps, where you can truly begin at the beginning and learn your way to deploy with confidence. We did.

  17. kathyonu revised this gist Jun 19, 2018. 1 changed file with 275 additions and 139 deletions.
    414 changes: 275 additions & 139 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -1,92 +1,171 @@
    *Commands to keep your app healthy, Ruby and Rails gems wise.*
    *Each command is described further below.*
    *Open new Terminal:*
    *Open new Terminal, note the gemsets showing:*

    ``rvm get stable``
    ``brew update``
    ``brew doctor``
    ``rvm list known``
    ``ruby -v``
    ``rvm gemset list``
    ``rvm gemset use global``
    ``gem update --system``
    ``gem update rake``
    ``gem update bundler``
    ``gem update rubygems-bundler``
    ``gem outdated``
    `rvm gemset list`

    A VALID NOTE from [stackoverflow](http://stackoverflow.com/questions/28941173/unable-to-obtain-stable-firefox-connection-in-60-seconds-127-0-0-17055) .. "don't ever use 'bundle update' or 'gem update' arbitrarily. That's like saying "give me the newest versions of all gems from all available sources" without knowing the effects beforehand. It can be a Pandora's Box of trouble if you aren't careful, especially 'bundle update'."
    You will see you are using the (default) gemset.
    Keep your system up to date with `rvm` and `brew`:

    The solution to this problem causer is to update gems one at a time, and run tests. This method lets you better learn each Gem as you go along, and prevents your being overwhelmed with breaks in your app. When you have tests in place covering your code, finding the causes of those breaks becomes easy peasy lemon squeezey.
    `rvm get stable`
    `brew update`
    `brew doctor`
    `rvm list known`

    The part you are most interested in this day of 20170924 reads as:

    `[ruby-]2.2[.7]`
    `[ruby-]2.3[.4]`
    `[ruby-]2.4[.1]`
    `ruby-head`

    Now, check your ruby version, just so you know,
    upgrading command comes later, make no change at this point.

    `ruby -v`
    `rvm gemset list`
    `rvm gemset use global`
    `gem update --system`
    `gem update rake`
    `gem update bundler`
    `gem update rubygems-bundler`
    `gem outdated`

    A VALID NOTE from [stackoverflow](http://stackoverflow.com/questions/28941173/unable-to-obtain-stable-firefox-connection-in-60-seconds-127-0-0-17055)
    "don't ever use 'bundle update' or 'gem update' arbitrarily. That's like saying
    "give me the newest versions of all gems from all available sources" without knowing
    the effects beforehand. It can be a Pandora's Box of trouble if you aren't careful,
    especially 'bundle update'."

    The solution to this problem causer is to update gems one at a time, and run tests.
    This method lets you easily check each Gem's upgrades as you go along, and prevents
    your being overwhelmed with breaks in your app. When you have tests in place covering
    your code, finding the causes of those breaks becomes easy peasy lemon squeezey.

    EXAMPLE: `bundle update selenium-webdriver` and then run your tests, to check.
    EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``gem update``
    ``rvm list known``
    ``rvm install 2.4.1``
    ``pwd``
    ``cd your_application_name``
    ``rvm gemset list``
    ``open -e Gemfile`` *: change Ruby version*
    ``open -e .ruby-version`` *: change Ruby version*
    ``open -e .ruby-gemset`` *: change Ruby version*
    ``rvm use 2.4.1``
    `gem update`
    `rvm list known`
    `rvm install 2.4.1` : adjust versions as needed if Gist not current to latest Ruby or Rails versions.

    `pwd` : check where you are any time you wish.

    `cd your_application_name`
    `rvm gemset list`
    `open -e Gemfile` *: change Ruby version*
    `open -e .ruby-version` *: change Ruby version*
    `open -e .ruby-gemset` *: change Ruby version*
    `rvm use 2.4.1`

    Before you upgrade to Ruby 2.4.1, see:
    [Behavior Changes in Ruby 2.4](https://wyeworks.com/blog/2016/6/22/behavior-changes-in-ruby-2.4)

    We are still using global gemset, so now we create
    new gemset for the app for first time creation use:
    ``rvm gemset use Rails4.2_your_app_name --create --default``
    `rvm gemset use Rails4.2_your_app_name --create --default`

    With above command used once, below is never needed:

    `rvm gemset use Rails4.2_app_name`

    Normal useage commands:
    ``rvm gemset list``
    ``rvm gemset use Rails4.2_your_app_name``
    ``ruby -v``
    ``rails -v``
    `rvm gemset list`
    `rvm gemset use Rails4.2_your_app_name`
    `ruby -v`
    `rails -v`
    *To upgrade your rails version, do this:*
    ``open -e Gemfile``
    *Change Rails version to upgrade*
    ``gem install rails --version 4.2.10``
    `open -e Gemfile` : *Change Rails version to upgrade*
    `gem install rails --version 4.2.10`

    Continuing, no matter your Rails version or gem install:
    ``bundle update rails``
    ``bundle install``
    ``rake rails:update``
    ``bundle outdated``

    See A VALID NOTE above.

    ``bundle update``
    ``rake rails:update:bin``
    ``ruby -v``
    ``rails -v``
    ``gem list``

    `ruby -v`
    `rails -v`

    If all is well on rails response, skip down to

    `bundle update rails`

    otherwise do this:

    `open -e Gemfile` : to change Rails version to 4.2.10, then run

    `gem install rails` : If all is not well, check your gemset with:

    `rvm gemset list` : decipher the terminal response.

    If you see an error such as:
    `Ignoring executable-hooks-1.3.2 because its extensions are not built.`
    `Try: gem pristine executable-hooks --version x.x.x`

    Do not do the Try suggestion.
    It means you are in the default or global gemset or you have a brand new gemset.
    Verify your app's gemset with:

    `rvm gemset list`

    Changing gemset will work if you are in wrong one, or ..
    With new gemset selected, run:

    `gem install rails`

    NOW, you can run this one:

    `bundle update rails`

    If you ever lose track of where you are, commands wise, just type into your Terminal:

    `history`

    Now, run `bundle_install` and it should be clean through up to date, no additions or changes:

    `bundle install`

    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:

    `bundle outdated`

    Next command is not a safe one, possibly updating many gems, changing many things:

    See A VALID NOTE above, and note here below before running `bundle update`

    Run `bundle outdated` before you blindly run the following update command.
    You can see how many gems will be updated if all are done with one command.
    You can update gems one by one with `bundle update gem_name`

    Recommend you do a `git commit` command before you run this
    updates-all-gems-command, IF you have many gems outdated.

    `bundle update`
    `ruby -v`

    Returns : ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

    `rails -v`
    `Rails 4.2.10`

    `gem list`

    Before you push to production, check your Gemfile.lock for vulnerabilites:
    [Is It Vulnerable ?](https://isitvulnerable.com/)

    ### Explanations :

    **#rvm get stable** updates your rvm:
    > `rvm get stable`
    rvm get stable : updates your rvm:

    **#brew update** will update your Homebrew (takes a while):
    > `brew update`
    `rvm get stable`

    **#brew doctor** will tell you all is well with your Homebrew (takes a while):
    > `brew doctor`
    brew update : will update your Homebrew (takes a while):

    **#rvm list known** will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.
    `rvm list known`

    **#pwd** will show you what directory you are in:
    > `pwd`
    brew doctor : will tell you all is well with your Homebrew (takes a while):

    Change into your working directory:
    > `cd your-application-name`
    `brew doctor`

    Check your Ruby version. Expect version to be 2.4.1 or later:
    > `ruby -v`
    @@ -101,8 +180,40 @@ Yes, change the _app_name to your app's name for easy reference.
    For the first time use, we will add the create and default switches.
    > `rvm gemset use ruby-2.4.1@rails4.2_app_name --create --default`
    Run the prior command again, you will see the gemset is being used:
    > `rvm gemset list`
    rvm list known : will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.

    `rvm list known`

    pwd : will show you what directory you are in:

    `pwd`

    Change into your working directory:

    `cd your-application-name`

    Check your Ruby version. Expect version to be 2.4.1 or later:

    `ruby -v`

    Check your Rails version. Expect version to be 4.2.10 or later:
    `rails -v`

    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : Rails4.2_app_name
    Yes, change the app_name to your app's name for easy reference.
    When you upgrade to Rails5.1 simply create a new gemset, and you
    can revert to the Rails5.1 gemset should the need arise.

    For the first time use, we will add the create and default switches.

    `rvm gemset use Rails4.2 _app_name --create --default`

    Run thhis command again, you will see the gemset is being used:

    `rvm gemset list`

    You just created and are now using the application's gemset.
    The `--default` switch will cause this gemset to be used when
    @@ -112,11 +223,14 @@ the rvm magic show itself as it recognizes the new gemset.

    If you ever change gemsets, the `use` command is the way back.
    However, at this point, when you change directory into this app,
    the `.ruby-gemset` file will be used to set the correct gemset:
    > `rvm gemset use Rails4.2_app_name`
    the `.ruby-gemset` file will be used to set the correct gemset.

    You can use the command to change gemsets and change back:
    > `rvm gemset use Rails4.2_app_name`

    > `rvm gemset use Rails4.2_app_name`
    or, if you are already using Rails 5 ..

    > `rvm gemset use Rails5_app_name`
    Your app is now ready to go.
    @@ -128,147 +242,169 @@ As needed to be current, make appropriate changes here:
    > `bundle install`
    Before you push to production, check your Gemfile.lock for vulnerabilites:
    > [Is It Vulnerable ?](https://isitvulnerable.com/)
    [Is It Vulnerable ?](https://isitvulnerable.com/)

    Fire it up with:

    `rails s`

    ### INSTRUCTIONS :

    *Use the global gemset for this part.*
    ``rvm gemset list``
    Use the global gemset for this part.

    `rvm gemset list`

    You can now see the global gemset exists, now we use it.

    `rvm gemset use global`

    *You can now see the global gemset exists, now we use it.*
    ``rvm gemset use global``
    You are now using the global gemset, run the list command again,
    you will see it is so.

    *You are now using the global gemset, run the list command again,*
    *you will see it is so.*
    ``rvm gemset list``
    `rvm gemset list`

    #### Now we begin the updates :

    **#gem update --system** *does what it says, updates your system*
    ``gem update --system``
    gem update --system : does what it says, updates your system

    **#gem update rake** *does what it says, updates your rake gem*
    ``gem update rake``
    `gem update --system`

    **#gem update bundler** *does what it says, updates your bundler gem*
    ``gem update bundler``
    gem update rake : does what it says, updates your rake gem
    `gem update rake`

    **#gem update rubygems-bundler** *updates your rubygems-bundler gem*
    ``gem update rubygems-bundler``
    gem update bundler : does what it says, updates your bundler gem
    `gem update bundler`

    **#gem outdated** *checks global gemset for out of date gems*
    ``gem outdated``
    gem update rubygems-bundler : updates your rubygems-bundler gem
    `gem update rubygems-bundler`

    gem outdated : checks global gemset for out of date gems
    `gem outdated`

    See A VALID NOTE above.

    **#gem update** *will update the global gemset*
    ``gem update``
    gem update : will update the global gemset

    `gem update`

    Update work is now complete using the global gemset.
    Next step is to make sure you are in your working directory ..

    pwd : will show you what directory you are in.

    `pwd`

    *Update work is now complete using the global gemset.*
    *Next step is to make sure you are in your working directory ..*
    **#pwd** *will show you what directory you are in.*
    ``pwd``
    Change into your app directory.

    *Change into your app directory.*
    ``cd my_application_name``
    `cd my_application_name`

    *Now, we look for and change to the gemset the application is using.*
    ``rvm gemset list``
    Now, we look for and change to the gemset the application is using.

    `rvm gemset list`

    *Choose your correct gemset for your app, if you have more than one.*
    *If that gemset does not exist in the list, what i do is this :*
    *Make sure the Gemfile shows Ruby at 2.4.1*
    *Make sure the .ruby-version file shows 2.4.1*
    *You can use the `open -e file-address` command at the terminal_prompt.*

    ``open -e Gemfile`` : add the current version of Rails, we are using 4.2.10
    ``open -e .ruby-version`` : currently it reads as 2.4.1p111
    ``open -e .ruby-gemset`` : currently reads as Rails-4_2_app_name
    `open -e Gemfile` : add the current version of Rails, we are using 4.2.10
    `open -e .ruby-version` : currently it reads as 2.4.1p111
    `open -e .ruby-gemset` : currently reads as Rails-4_2_app_name

    Make sure the `.ruby-gemset` file reads as your real `app-gemset-name` .
    That means the only thing in the .ruby-gemset file should be, Rails-4_2_app_name

    *Make sure the* ``.ruby-gemset`` *file reads as your real* ``app-gemset-name``.
    *Further below, we will be giving the gemset the name of,* ``Rails4.2_app_name``.
    ruby -v : will respond with your Ruby version.

    **#ruby -v** *will respond with your Ruby version.*
    ``ruby -v``
    `ruby -v`

    *If the response is not 2.4.1, tell rvm to use Ruby-2.4.1*
    ``rvm use 2.4.1``
    `rvm use 2.4.1`

    *If the response is not, **You are now using Ruby 2.4.1**, run
    **#rvm list known** to show you what rubies rvm knows about.*
    ``rvm list known``
    `rvm list known`

    *If the 2.4.1 Ruby is not showing, run this lovely command.*
    ``rvm install 2.4.1``
    `rvm install 2.4.1`

    *Watch for rvm install instructions, if any, and use them.*
    *Voila, you are now on Ruby 2.4.1 and yes, it is that easy.*
    *Now that you are using 2.4.1 we can create the gemset. *
    ``rvm gemset use Rails4.2_app_name --create --default``

    *At this point, I personally like to close that terminal window*
    *and open a new one, and watch the rvm magic show itself as it*
    *recognizes the new gemset, if this is the first time you set it.*
    `rvm gemset use Rails4.2_app_name --create --default`

    At this point, I personally like to close that terminal window
    and open a new one, and watch the rvm magic show itself as it
    recognizes the new gemset, if this is the first time you set it.

    If you ever change gemsets, this is the way back.
    (However, at this point, when you change directory into this app,
    the .ruby-gemset file will be used to set the correct gemset.)

    *If you ever change gemsets, this is the way back. *
    *(However, at this point, when you change directory into this app,*
    *the .ruby-gemset file will be used to set the correct gemset.)*
    ``rvm gemset use Rails4.2_app_name``
    `rvm gemset use Rails5.1_app_name`

    Check your Ruby version. Expect version to be 2.4.1

    *Check your Ruby version. Expect version to be 2.4.1*
    ``ruby -v``
    `ruby -v`

    *Check your Rails version. Expect version to be 4.2.10*
    ``rails -v``
    `rails -v`

    *If you are not yet using Rails4.2.10, this is the command to install:*
    `gem install rails`

    Notice it is not, `bundle install` here, we used `gem install`.
    Make sure you do not skip this next step.

    `bundle update rails`

    *If you are not yet using Rails4.2.10, this is the point that you do so.*
    ``gem install rails``
    `bundle install`

    *Notice it is not, ``bundle install`` here, we use ``gem install``.*
    It should be a clean response with no additions or changes.
    If you have difficulties here, trash your Gemfile.lock file, then run this command again.

    *Make sure you do not skip this next step.*
    ``bundle update rails``
    `bundle install`

    *Now we let Bundler do its work of installing all the requisite gems, and dependencies.*
    ``bundle install``

    *If you have difficulties here, trash your Gemfile.lock file, then run the
    ``bundle install`` command again.*
    Next we update Rails and it is important to do this every time you upgrade Rails versions.

    `rake rails:update`

    *Next we update Rails and it is important to do this every time you upgrade Rails versions.*
    ``rake rails:update``
    If the process asks you if you want to overwrite a file, type in
    `d` for `diff` and it will show you the changes it is about to make.
    If you have working code in your file that cannot be overwritten,
    and yet there is new code to be added, simply open the file it wants to overwrite,
    and make those additions by hand, save the file, close it,
    and choose `n` : do not allow the overwrite. That preserves your code and adds new.

    *If the process asks you if you want to overwrite a file, type in ``diff`` and it will*
    *show you the changes it is about to make. If you have working code in your file,*
    *that cannot be overwritten, and yet there is new code to be added, simply open*
    *the file it wants to overwrite, and make those additions by hand, save the file, close it, and choose ``n`` : do not allow the overwrite. That preserves your code and adds new.*
    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in `d` for `diff` ..
    Do not allow overwrite of spring codes in the bin/files.

    > *An example is if you are using the Spring gem, you will see codes with /spring/ in the bin file overwrite question, after you type in <code>diff</code> : do not allow overwrite of spring codes in the bin/files.*
    Now is a good time to update your bundled gems.*
    bundle outdated : will show you all outdated gems in the gemset you are using.

    *Now is a good time to update your bundled gems.*
    **#bundle outdated will show you all outdated gems in the gemset you are using.**
    ``bundle outdated``
    `bundle outdated`

    See A VALID NOTE above.

    **#bundle update will update your gems.**
    ``bundle update``
    bundle update : will will update your gems.

    *Bundler now does its magic.*
    *Follow any instructions bundler gives you while it updates.*
    `bundle update`

    **#rake rails:update:bin** *will update your bin/bundle, bin/rails and bin/rake files.*
    ``rake rails:update:bin``
    Bundler now does its magic.
    Follow any instructions bundler gives you while it updates.

    *Now check your Rails version, it should read 4.2.10 *
    ``rails -v``
    `rails -v`

    *Your Ruby version should read as 2.4.1 *
    ``ruby -v``
    `ruby -v`

    ###### Your app is now updated, Ruby, Rails and gems wise
    ###### Welcome to the Near Edge of Ruby on Rails
    Your app is now updated, Ruby, Rails and gems wise
    Welcome to the Nearest Edge of Ruby on Rails
    Three cheers for your Rails app's health - [This Gister](https://github.com/kathyonu)

    This list draws heavily upon my learnings with [RailsApps Tutorials](https://tutorials.railsapps.org/), specifically [Updating to Rails 4.2](http://railsapps.github.io/updating-rails.html).
  18. kathyonu revised this gist Jun 19, 2018. 1 changed file with 43 additions and 32 deletions.
    75 changes: 43 additions & 32 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -19,27 +19,38 @@ A VALID NOTE from [stackoverflow](http://stackoverflow.com/questions/28941173/un

    The solution to this problem causer is to update gems one at a time, and run tests. This method lets you better learn each Gem as you go along, and prevents your being overwhelmed with breaks in your app. When you have tests in place covering your code, finding the causes of those breaks becomes easy peasy lemon squeezey.

    EXAMPLE: `bundle update selenium-webdriver` and then run your tests, to check.
    EXAMPLE: `bundle update selenium-webdriver` and then run your tests, to check.
    EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``gem update``
    ``rvm list known``
    ``rvm install 2.3.0``
    ``rvm install 2.4.1``
    ``pwd``
    ``cd your_application_name``
    ``rvm gemset list``
    ``open -e Gemfile`` *: change Ruby version*
    ``open -e .ruby-version`` *: change Ruby version*
    ``open -e .ruby-gemset`` *: change Ruby version*
    ``rvm use 2.3.0``
    ``rvm gemset use Rails4.2_app_name --create --default``
    *with above command used once, below is never needed*
    ``rvm gemset use Rails4.2_app_name``
    ``rvm use 2.4.1``

    Before you upgrade to Ruby 2.4.1, see:
    [Behavior Changes in Ruby 2.4](https://wyeworks.com/blog/2016/6/22/behavior-changes-in-ruby-2.4)

    We are still using global gemset, so now we create
    new gemset for the app for first time creation use:
    ``rvm gemset use Rails4.2_your_app_name --create --default``

    Normal useage commands:
    ``rvm gemset list``
    ``rvm gemset use Rails4.2_your_app_name``
    ``ruby -v``
    ``rails -v``
    *If all is well on rails response, skip to `bundle update rails`, otherwise do this:
    ``open -e Gemfile`` *: change Rails version*
    ``gem install rails``
    *To upgrade your rails version, do this:*
    ``open -e Gemfile``
    *Change Rails version to upgrade*
    ``gem install rails --version 4.2.10``

    Continuing, no matter your Rails version or gem install:
    ``bundle update rails``
    ``bundle install``
    ``rake rails:update``
    @@ -68,7 +79,7 @@ Before you push to production, check your Gemfile.lock for vulnerabilites:
    > `brew doctor`
    **#rvm list known** will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.3.0 in the list, we will cover what to do further below.
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.
    `rvm list known`

    **#pwd** will show you what directory you are in:
    @@ -77,18 +88,18 @@ If you do not see Ruby 2.3.0 in the list, we will cover what to do further below
    Change into your working directory:
    > `cd your-application-name`
    Check your Ruby version. Expect version to be 2.3.0 or later:
    Check your Ruby version. Expect version to be 2.4.1 or later:
    > `ruby -v`
    Check your Rails version. Expect version to be 4.2.6 or later:
    Check your Rails version. Expect version to be 4.2.10 or 5.0 or later:
    > `rails -v`
    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : **Rails4.2_app_name**
    Yes, change the _app_name to your app's name for easy reference.
    For the first time use, we will add the create and default switches.
    > `rvm gemset use Rails4.2_app_name --create --default`
    > `rvm gemset use ruby-2.4.1@rails4.2_app_name --create --default`
    Run the prior command again, you will see the gemset is being used:
    > `rvm gemset list`
    @@ -106,20 +117,20 @@ the `.ruby-gemset` file will be used to set the correct gemset:
    You can use the command to change gemsets and change back:
    > `rvm gemset use Rails4.2_app_name`
    > `rvm gemset use Rails5_app_name_stage`
    > `rvm gemset use Rails5_app_name`
    Your app is now ready to go.
    At any time you can do the steps above to keep your app humming.

    As needed to be current, make appropriate changes here:
    As needed to be current, make appropriate changes here:
    > `open -e .ruby-gemset`
    > `open -e .ruby-version`
    > `bundle install`
    Before you push to production, check your Gemfile.lock for vulnerabilites:
    > [Is It Vulnerable ?](https://isitvulnerable.com/)
    ### INSTRUCTIONS :
    ### INSTRUCTIONS :

    *Use the global gemset for this part.*
    ``rvm gemset list``
    @@ -166,12 +177,12 @@ See A VALID NOTE above.

    *Choose your correct gemset for your app, if you have more than one.*
    *If that gemset does not exist in the list, what i do is this :*
    *Make sure the Gemfile shows Ruby at 2.3.0*
    *Make sure the .ruby-version file shows 2.3.0*
    *Make sure the Gemfile shows Ruby at 2.4.1*
    *Make sure the .ruby-version file shows 2.4.1*
    *You can use the `open -e file-address` command at the terminal_prompt.*

    ``open -e Gemfile`` : add the current version of Rails, currently 4.2.6
    ``open -e .ruby-version`` : currently it reads as 2.2.3
    ``open -e Gemfile`` : add the current version of Rails, we are using 4.2.10
    ``open -e .ruby-version`` : currently it reads as 2.4.1p111
    ``open -e .ruby-gemset`` : currently reads as Rails-4_2_app_name

    *Make sure the* ``.ruby-gemset`` *file reads as your real* ``app-gemset-name``.
    @@ -180,19 +191,19 @@ See A VALID NOTE above.
    **#ruby -v** *will respond with your Ruby version.*
    ``ruby -v``

    *If the response is not 2.3.0, tell rvm to use Ruby-2.3.0*
    ``rvm use 2.3.0``
    *If the response is not 2.4.1, tell rvm to use Ruby-2.4.1*
    ``rvm use 2.4.1``

    *If the response is not, **You are now using Ruby 2.3.0**, run
    *If the response is not, **You are now using Ruby 2.4.1**, run
    **#rvm list known** to show you what rubies rvm knows about.*
    ``rvm list known``

    *If the 2.3.0 Ruby is not showing, run this lovely command.*
    ``rvm install 2.3.0``
    *If the 2.4.1 Ruby is not showing, run this lovely command.*
    ``rvm install 2.4.1``

    *Watch for rvm install instructions, if any, and use them.*
    *Voila, you are now on Ruby 2.3.0 and yes, it is that easy.*
    *Now that you are using 2.3.0 we can create the gemset. *
    *Voila, you are now on Ruby 2.4.1 and yes, it is that easy.*
    *Now that you are using 2.4.1 we can create the gemset. *
    ``rvm gemset use Rails4.2_app_name --create --default``

    *At this point, I personally like to close that terminal window*
    @@ -204,13 +215,13 @@ See A VALID NOTE above.
    *the .ruby-gemset file will be used to set the correct gemset.)*
    ``rvm gemset use Rails4.2_app_name``

    *Check your Ruby version. Expect version to be 2.3.0*
    *Check your Ruby version. Expect version to be 2.4.1*
    ``ruby -v``

    *Check your Rails version. Expect version to be 4.2.6*
    *Check your Rails version. Expect version to be 4.2.10*
    ``rails -v``

    *If you are not yet using Rails4.2.6, this is the point that you do so.*
    *If you are not yet using Rails4.2.10, this is the point that you do so.*
    ``gem install rails``

    *Notice it is not, ``bundle install`` here, we use ``gem install``.*
    @@ -250,10 +261,10 @@ See A VALID NOTE above.
    **#rake rails:update:bin** *will update your bin/bundle, bin/rails and bin/rake files.*
    ``rake rails:update:bin``

    *Now check your Rails version, it should read 4.2.6 *
    *Now check your Rails version, it should read 4.2.10 *
    ``rails -v``

    *Your Ruby version should read as 2.3.0 *
    *Your Ruby version should read as 2.4.1 *
    ``ruby -v``

    ###### Your app is now updated, Ruby, Rails and gems wise
  19. kathyonu revised this gist Mar 25, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -72,7 +72,7 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    otherwise do this:

    ``open -e Gemfile`` : to change Rails version to 2.4.1, then run
    ``open -e Gemfile`` : to change Rails version to 5.1.2, then run

    ``gem install rails`` : If all is not well, check your gemset with:

  20. kathyonu revised this gist Jan 22, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -122,7 +122,8 @@ Verify your app's gemset with:
    updates-all-gems-command, IF you have many gems outdated.

    ``bundle update``
    ``ruby -v``
    ``ruby -v``

    Returns : ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

    ``rails -v``
  21. kathyonu revised this gist Jan 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -123,7 +123,7 @@ Verify your app's gemset with:

    ``bundle update``
    ``ruby -v``
    ``ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]``
    Returns : ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

    ``rails -v``
    ``Rails 5.1.2``
  22. kathyonu revised this gist Jan 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -121,7 +121,7 @@ Verify your app's gemset with:
    Recommend you do a `git commit` command before you run this
    updates-all-gems-command, IF you have many gems outdated.

    ``bundle update``
    ``bundle update``
    ``ruby -v``
    ``ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]``

  23. kathyonu revised this gist Sep 24, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -78,13 +78,13 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``rvm gemset list`` : decipher the terminal response.

    ```If you see an error such as:
    Ignoring executable-hooks-1.3.2 because its extensions are not built.
    Try: gem pristine executable-hooks --version x.x.x
    If you see an error such as:
    ``Ignoring executable-hooks-1.3.2 because its extensions are not built.``
    ``Try: gem pristine executable-hooks --version x.x.x``

    ```Do not do the Try suggestion.
    It means you are in the default or global gemset or you have a brand new gemset.
    Verify your app's gemset with:
    Do not do the Try suggestion.
    It means you are in the default or global gemset or you have a brand new gemset.
    Verify your app's gemset with:

    ``rvm gemset list``

  24. kathyonu revised this gist Sep 24, 2017. 1 changed file with 40 additions and 30 deletions.
    70 changes: 40 additions & 30 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -12,14 +12,15 @@ Keep your system up to date with `rvm` and `brew`:
    ``brew doctor``
    ``rvm list known``

    The part you are most interested in is this day of 20170924 readds as:
    The part you are most interested in this day of 20170924 reads as:

    ``[ruby-]2.2[.7]``
    ``[ruby-]2.2[.7]``
    ``[ruby-]2.3[.4]``
    ``[ruby-]2.4[.1]``
    ``ruby-head``

    Now, check your ruby version, just so you know, upgrading command comes later, make no change at this point.
    Now, check your ruby version, just so you know,
    upgrading command comes later, make no change at this point.

    ``ruby -v``
    ``rvm gemset list``
    @@ -30,17 +31,25 @@ Now, check your ruby version, just so you know, upgrading command comes later, m
    ``gem update rubygems-bundler``
    ``gem outdated``

    A VALID NOTE from [stackoverflow](http://stackoverflow.com/questions/28941173/unable-to-obtain-stable-firefox-connection-in-60-seconds-127-0-0-17055) .. "don't ever use 'bundle update' or 'gem update' arbitrarily. That's like saying "give me the newest versions of all gems from all available sources" without knowing the effects beforehand. It can be a Pandora's Box of trouble if you aren't careful, especially 'bundle update'."
    A VALID NOTE from [stackoverflow](http://stackoverflow.com/questions/28941173/unable-to-obtain-stable-firefox-connection-in-60-seconds-127-0-0-17055)
    "don't ever use 'bundle update' or 'gem update' arbitrarily. That's like saying
    "give me the newest versions of all gems from all available sources" without knowing
    the effects beforehand. It can be a Pandora's Box of trouble if you aren't careful,
    especially 'bundle update'."

    The solution to this problem causer is to update gems one at a time, and run tests. This method lets you easily check each Gem's upgrades as you go along, and prevents your being overwhelmed with breaks in your app. When you have tests in place covering your code, finding the causes of those breaks becomes easy peasy lemon squeezey.
    The solution to this problem causer is to update gems one at a time, and run tests.
    This method lets you easily check each Gem's upgrades as you go along, and prevents
    your being overwhelmed with breaks in your app. When you have tests in place covering
    your code, finding the causes of those breaks becomes easy peasy lemon squeezey.

    EXAMPLE: `bundle update selenium-webdriver` and then run your tests, to check.
    EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``gem update``
    ``rvm list known``
    ``rvm install 2.4.1`` : adjust versions as needed, Gist not always current to latest Ruby or Rails versions.
    ``pwd``
    ``rvm install 2.4.1`` : adjust versions as needed if Gist not current to latest Ruby or Rails versions.

    ``pwd`` : check where you are any time you wish.

    ``cd your_application_name``
    ``rvm gemset list``
    @@ -52,9 +61,10 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    with above command used once, below is never needed

    ``rvm gemset use Rails5.1_app_name``
    ``rvm gemset use Rails5.1_app_name``

    ``ruby -v``
    ``rails -v``
    ``rails -v``

    If all is well on rails response, skip down to

    @@ -70,18 +80,18 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ```If you see an error such as:
    Ignoring executable-hooks-1.3.2 because its extensions are not built.
    Try: gem pristine executable-hooks --version x.x.x```
    Try: gem pristine executable-hooks --version x.x.x
    ```Do not do the Try suggestion.
    It means you are in the default or global gemset or you have a brand new gemset.
    Verify your app's gemset with:```
    Verify your app's gemset with:
    ``rvm gemset list``
    Changing gemset will work if you are in wrong one, or ..
    With new gemset selected, run:
    `gem install rails`
    ``gem install rails``
    NOW, you can run this one:
    @@ -127,35 +137,35 @@ Before you push to production, check your Gemfile.lock for vulnerabilites:
    rvm get stable : updates your rvm:
    `rvm get stable`
    ``rvm get stable``
    brew update : will update your Homebrew (takes a while):
    `brew update`
    ``brew update``
    brew doctor : will tell you all is well with your Homebrew (takes a while):
    `brew doctor`
    ``brew doctor``
    rvm list known : will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.
    `rvm list known`
    ``rvm list known``
    pwd : will show you what directory you are in:
    `pwd`
    ``pwd``
    Change into your working directory:
    `cd your-application-name`
    ``cd your-application-name``
    Check your Ruby version. Expect version to be 2.4.1 or later:
    `ruby -v`
    ``ruby -v``
    Check your Rails version. Expect version to be 5.1.2 or later:
    > `rails -v`
    ``rails -v``
    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    @@ -166,37 +176,37 @@ When you upgrade to Rails5.1 simply create a new gemset, and you
    For the first time use, we will add the create and default switches.
    `rvm gemset use Rails5.1_app_name --create --default`
    ``rvm gemset use Rails5.1_app_name --create --default``
    Run thhis command again, you will see the gemset is being used:
    `rvm gemset list`
    ``rvm gemset list``
    You just created and are now using the application's gemset.
    The `--default` switch will cause this gemset to be used when
    The ``--default`` switch will cause this gemset to be used when
    you first enter the app directory. At this point, I personally
    like to close that terminal window and open a new one, and watch
    the rvm magic show itself as it recognizes the new gemset.
    If you ever change gemsets, the `use` command is the way back.
    However, at this point, when you change directory into this app,
    the `.ruby-gemset` file will be used to set the correct gemset.
    the ``.ruby-gemset`` file will be used to set the correct gemset.
    You can use the command to change gemsets and change back:
    `rvm gemset use Rails5.1_app_name`
    `rvm gemset use Rails5.2_app_name`
    ``rvm gemset use Rails5.1_app_name``
    ``rvm gemset use Rails5.2_app_name``
    Your app is now ready to go.
    At any time you can do the steps above to keep your app humming.
    As needed to be current, make appropriate changes here:
    > `open -e .ruby-gemset`
    > `open -e .ruby-version`
    > `bundle install`
    ``open -e .ruby-gemset``
    ``open -e .ruby-version``
    ``bundle install``
    Before you push to production, check your Gemfile.lock for vulnerabilites:
    > [Is It Vulnerable ?](https://isitvulnerable.com/)
    [Is It Vulnerable ?](https://isitvulnerable.com/)
    Fire it up with:
  25. kathyonu revised this gist Sep 24, 2017. 1 changed file with 141 additions and 98 deletions.
    239 changes: 141 additions & 98 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -4,22 +4,22 @@

    ``rvm gemset list``

    *You will see you are using the (default) gemset.*
    *Keep your system up to date with `rvm` and `brew`:*
    You will see you are using the (default) gemset.
    Keep your system up to date with `rvm` and `brew`:

    ``rvm get stable``
    ``brew update``
    ``brew doctor``
    ``brew doctor``
    ``rvm list known``

    *The part you are most interested in is this day of 20170924 readds as:*
    The part you are most interested in is this day of 20170924 readds as:

    ``[ruby-]2.2[.7]``
    ``[ruby-]2.3[.4]``
    ``[ruby-]2.4[.1]``
    ``[ruby-]2.2[.7]``
    ``[ruby-]2.3[.4]``
    ``[ruby-]2.4[.1]``
    ``ruby-head``

    *Now, check your ruby version, just so you know, upgrading command comes later, make no change at this point.*
    Now, check your ruby version, just so you know, upgrading command comes later, make no change at this point.

    ``ruby -v``
    ``rvm gemset list``
    @@ -39,37 +39,47 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``gem update``
    ``rvm list known``
    ``rvm install 2.4.1`` *: adjust as needed, this app may not always be current to latest Ruby or Rails versions.*
    ``rvm install 2.4.1`` : adjust versions as needed, Gist not always current to latest Ruby or Rails versions.
    ``pwd``

    ``cd your_application_name``
    ``rvm gemset list``
    ``open -e Gemfile`` *: change Ruby version*
    ``open -e .ruby-version`` *: change Ruby version*
    ``open -e .ruby-gemset`` *: change Ruby version*
    ``open -e Gemfile`` : change Ruby version
    ``open -e .ruby-version`` : change Ruby version
    ``open -e .ruby-gemset`` : change Ruby version
    ``rvm use 2.4.1``
    ``rvm gemset use Rails5_app_name --create --default``

    *with above command used once, below is never needed*
    with above command used once, below is never needed

    ``rvm gemset use Rails5.1_app_name``
    ``ruby -v``
    ``rails -v``

    *If all is well on rails response*, skip to `bundle update rails`, otherwise do this:
    ``open -e Gemfile`` *: change Rails version*
    If all is well on rails response, skip down to

    ``gem install rails``
    `bundle update rails`

    If all is not well, check your gemset with `rvm gemset list` and decipher terminal response.
    If you see an error such as:
    ```Ignoring executable-hooks-1.3.2 because its extensions are not built.
    Try: gem pristine executable-hooks --version 1.3.2```
    It means you have are in global gemset or you have a new gemset, and you need to verify your gemset with:
    otherwise do this:

    ``open -e Gemfile`` : to change Rails version to 2.4.1, then run

    ``gem install rails`` : If all is not well, check your gemset with:

    `rvm gemset list`
    ``rvm gemset list`` : decipher the terminal response.

    ```If you see an error such as:
    Ignoring executable-hooks-1.3.2 because its extensions are not built.
    Try: gem pristine executable-hooks --version x.x.x```
    ```Do not do the Try suggestion.
    It means you are in the default or global gemset or you have a brand new gemset.
    Verify your app's gemset with:```
    ``rvm gemset list``
    changing gemset will work, or, with new gemset selected, run:
    Changing gemset will work if you are in wrong one, or ..
    With new gemset selected, run:
    `gem install rails`
    @@ -115,34 +125,41 @@ Before you push to production, check your Gemfile.lock for vulnerabilites:
    ### Explanations :
    **#rvm get stable** updates your rvm:
    > `rvm get stable`
    rvm get stable : updates your rvm:
    `rvm get stable`
    brew update : will update your Homebrew (takes a while):
    `brew update`
    brew doctor : will tell you all is well with your Homebrew (takes a while):
    **#brew update** will update your Homebrew (takes a while):
    > `brew update`
    `brew doctor`
    **#brew doctor** will tell you all is well with your Homebrew (takes a while):
    > `brew doctor`
    rvm list known : will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.
    **#rvm list known** will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.
    `rvm list known`
    **#pwd** will show you what directory you are in:
    > `pwd`
    pwd : will show you what directory you are in:
    Change into your working directory:
    > `cd your-application-name`
    `pwd`
    Change into your working directory:
    `cd your-application-name`
    Check your Ruby version. Expect version to be 2.4.1 or later:
    > `ruby -v`
    `ruby -v`
    Check your Rails version. Expect version to be 5.1.2 or later:
    > `rails -v`
    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : **Rails5.1_app_name**
    We will create a good name for it : Rails5.1_app_name
    Yes, change the app_name to your app's name for easy reference.
    When you upgrade to Rails5.1 simply create a new gemset, and you
    can revert to the Rails5.1 gemset should the need arise.
    @@ -187,141 +204,167 @@ Fire it up with:
    ### INSTRUCTIONS :
    *Use the global gemset for this part.*
    Use the global gemset for this part.
    ``rvm gemset list``
    *You can now see the global gemset exists, now we use it.*
    ``rvm gemset use global``
    You can now see the global gemset exists, now we use it.
    ``rvm gemset use global``
    You are now using the global gemset, run the list command again,
    you will see it is so.
    *You are now using the global gemset, run the list command again,*
    *you will see it is so.*
    ``rvm gemset list``
    #### Now we begin the updates :
    **#gem update --system** *does what it says, updates your system*
    gem update --system : does what it says, updates your system
    ``gem update --system``
    **#gem update rake** *does what it says, updates your rake gem*
    gem update rake : does what it says, updates your rake gem
    ``gem update rake``
    **#gem update bundler** *does what it says, updates your bundler gem*
    gem update bundler : does what it says, updates your bundler gem
    ``gem update bundler``
    **#gem update rubygems-bundler** *updates your rubygems-bundler gem*
    gem update rubygems-bundler : updates your rubygems-bundler gem
    ``gem update rubygems-bundler``
    **#gem outdated** *checks global gemset for out of date gems*
    gem outdated : checks global gemset for out of date gems
    ``gem outdated``
    See A VALID NOTE above.
    **#gem update** *will update the global gemset*
    gem update : will update the global gemset
    ``gem update``
    *Update work is now complete using the global gemset.*
    *Next step is to make sure you are in your working directory ..*
    **#pwd** *will show you what directory you are in.*
    Update work is now complete using the global gemset.
    Next step is to make sure you are in your working directory ..
    pwd : will show you what directory you are in.
    ``pwd``
    *Change into your app directory.*
    Change into your app directory.
    ``cd my_application_name``
    *Now, we look for and change to the gemset the application is using.*
    Now, we look for and change to the gemset the application is using.
    ``rvm gemset list``
    *Choose your correct gemset for your app, if you have more than one.*
    *If that gemset does not exist in the list, what i do is this :*
    *Make sure the Gemfile shows Ruby at 2.3.0*
    *Make sure the .ruby-version file shows 2.3.0*
    *You can use the `open -e file-address` command at the terminal_prompt.*
    Choose your correct gemset for your app, if you have more than one.
    If that gemset does not exist in the list, what i do is this :
    Make sure the Gemfile shows Ruby at 2.3.0
    Make sure the .ruby-version file shows 2.3.0
    You can use the `open -e file-address` command at the terminal_prompt.
    ``open -e Gemfile`` : add the current version of Rails, currently 5.1.2
    ``open -e .ruby-version`` : currently it reads as 2.4.1
    ``open -e .ruby-gemset`` : currently reads as Rails5.1_app_name
    *Make sure the* ``.ruby-gemset`` *file reads as your real* ``app-gemset-name``.
    *Further below, we will be giving the gemset the name of,* ``Rails5.1_app_name``.
    Make sure the ``.ruby-gemset`` file reads as your real ``app-gemset-name`` .
    Further below, we will be giving the gemset the name of, ``Rails5.1_app_name`` .
    ruby -v : will respond with your Ruby version.
    **#ruby -v** *will respond with your Ruby version.*
    ``ruby -v``
    *If the response is not 2.4.1, tell rvm to use Ruby-2.4.1*
    If the response is not 2.4.1, tell rvm to use Ruby-2.4.1
    ``rvm use 2.4.1``
    *If the response is not, **You are now using Ruby 2.3.0**, run
    **#rvm list known** to show you what rubies rvm knows about.*
    If the response is not, *You are now using Ruby 2.3.0*, run:
    rvm list known : to show you what rubies rvm knows about.
    ``rvm list known``
    *If the 2.3.0 Ruby is not showing, run this lovely command.*
    If the 2.3.0 Ruby is not showing, run this lovely command.
    ``rvm install 2.4.1``
    *Watch for rvm install instructions, if any, and use them.*
    *Voila, you are now on Ruby 2.4.1 and yes, it is that easy.*
    *Now that you are using 2.4.1 we can create the gemset. *
    Watch for rvm install instructions, if any, and use them.
    Voila, you are now on Ruby 2.4.1 and yes, it is that easy.
    Now that you are using 2.4.1 we can create the gemset.
    ``rvm gemset use Rails5.1_app_name --create --default``
    *At this point, I personally like to close that terminal window*
    *and open a new one, and watch the rvm magic show itself as it*
    *recognizes the new gemset, if this is the first time you set it.*
    At this point, I personally like to close that terminal window
    and open a new one, and watch the rvm magic show itself as it
    recognizes the new gemset, if this is the first time you set it.
    If you ever change gemsets, this is the way back.
    (However, at this point, when you change directory into this app,
    the .ruby-gemset file will be used to set the correct gemset.)
    *If you ever change gemsets, this is the way back. *
    *(However, at this point, when you change directory into this app,*
    *the .ruby-gemset file will be used to set the correct gemset.)*
    ``rvm gemset use Rails5.1_app_name``
    *Check your Ruby version. Expect version to be 2.4.1*
    Check your Ruby version. Expect version to be 2.4.1
    ``ruby -v``
    *Check your Rails version. Expect version to be 5.1.2*
    Check your Rails version. Expect version to be 5.1.2
    ``rails -v``
    *If you are not yet using Rails5.1.2, this is the point that you do so.*
    If you are not yet using Rails5.1.2, this is the point that you do so.*
    ``gem install rails``
    *Notice it is not, ``bundle install`` here, we used ``gem install``.*
    Notice it is not, ``bundle install`` here, we used ``gem install``.
    Make sure you do not skip this next step.
    *Make sure you do not skip this next step.*
    ``bundle update rails``
    *Now we see if `bundle update rails` did its work of installing all the requisite gems, and dependencies.*
    ``bundle install``
    *It should be a clean response with no additions or changes.*
    It should be a clean response with no additions or changes.
    If you have difficulties here, trash your Gemfile.lock file, then run this command again.
    ``bundle install``
    *If you have difficulties here, trash your Gemfile.lock file, then run the
    ``bundle install`` command again.*
    Next we update Rails and it is important to do this every time you upgrade Rails versions.
    *Next we update Rails and it is important to do this every time you upgrade Rails versions.*
    ``rake rails:update``
    *If the process asks you if you want to overwrite a file, type in ``d`` for ``diff`` and it will*
    *show you the changes it is about to make. If you have working code in your file,*
    *that cannot be overwritten, and yet there is new code to be added, simply open*
    *the file it wants to overwrite, and make those additions by hand, save the file, close it, and choose ``n`` : do not allow the overwrite. That preserves your code and adds new.*
    *If the process asks you if you want to overwrite a file, type in
    ``d`` for ``diff`` and it will show you the changes it is about to make.
    If you have working code in your file that cannot be overwritten,
    and yet there is new code to be added, simply open the file it wants to overwrite,
    and make those additions by hand, save the file, close it,
    and choose ``n`` : do not allow the overwrite. That preserves your code and adds new.
    > *An example is if you are using the Spring gem, you will see codes with /spring/ in the bin file overwrite question, after you type in <code>diff</code> : do not allow overwrite of spring codes in the bin/files.*
    An example is if you are using the Spring gem, you will see codes with /spring/ in the
    bin file overwrite question, after you type in ``d`` for ``diff`` ..
    Do not allow overwrite of spring codes in the bin/files.
    Now is a good time to update your bundled gems.*
    bundle outdated : will show you all outdated gems in the gemset you are using.
    *Now is a good time to update your bundled gems.*
    **#bundle outdated will show you all outdated gems in the gemset you are using.**
    ``bundle outdated``
    See A VALID NOTE above.
    **#bundle update will update your gems.**
    bundle update : will will update your gems.
    ``bundle update``
    *Bundler now does its magic.*
    *Follow any instructions bundler gives you while it updates.*
    Bundler now does its magic.
    Follow any instructions bundler gives you while it updates.
    Now check your Rails version, it should read 5.1.2
    *Now check your Rails version, it should read 5.1.2*
    ``rails -v``
    *Your Ruby version should read as 2.4.1 *
    Your Ruby version should read as 2.4.1
    ``ruby -v``
    ###### Your app is now updated, Ruby, Rails and gems wise
    ###### Welcome to the Near Edge of Ruby on Rails
    Your app is now updated, Ruby, Rails and gems wise
    Welcome to the Nearest Edge of Ruby on Rails
    Three cheers for your Rails app's health - [This Gister](https://github.com/kathyonu)
    This list draws heavily upon my learnings with [RailsApps Tutorials](https://tutorials.railsapps.org/), specifically [Updating to Rails 4.2](http://railsapps.github.io/updating-rails.html).
  26. kathyonu revised this gist Sep 24, 2017. 1 changed file with 25 additions and 9 deletions.
    34 changes: 25 additions & 9 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,26 @@
    *Commands to keep your app healthy, Ruby and Rails gems wise.*
    *Each command is described further below.*
    *Open new Terminal:*
    *Open new Terminal, note the gemsets showing:*

    ``rvm gemset list``

    *You will see you are using the (default) gemset.*
    *Keep your system up to date with `rvm` and `brew`:*

    ``rvm get stable``
    ``brew update``
    ``brew doctor``
    ``rvm list known``
    ``brew doctor``
    ``rvm list known``

    *The part you are most interested in is this day of 20170924 readds as:*

    ``[ruby-]2.2[.7]``
    ``[ruby-]2.3[.4]``
    ``[ruby-]2.4[.1]``
    ``ruby-head``

    *Now, check your ruby version, just so you know, upgrading command comes later, make no change at this point.*

    ``ruby -v``
    ``rvm gemset list``
    ``rvm gemset use global``
    @@ -17,15 +32,16 @@

    A VALID NOTE from [stackoverflow](http://stackoverflow.com/questions/28941173/unable-to-obtain-stable-firefox-connection-in-60-seconds-127-0-0-17055) .. "don't ever use 'bundle update' or 'gem update' arbitrarily. That's like saying "give me the newest versions of all gems from all available sources" without knowing the effects beforehand. It can be a Pandora's Box of trouble if you aren't careful, especially 'bundle update'."

    The solution to this problem causer is to update gems one at a time, and run tests. This method lets you better learn each Gem as you go along, and prevents your being overwhelmed with breaks in your app. When you have tests in place covering your code, finding the causes of those breaks becomes easy peasy lemon squeezey.
    The solution to this problem causer is to update gems one at a time, and run tests. This method lets you easily check each Gem's upgrades as you go along, and prevents your being overwhelmed with breaks in your app. When you have tests in place covering your code, finding the causes of those breaks becomes easy peasy lemon squeezey.

    EXAMPLE: `bundle update selenium-webdriver` and then run your tests, to check.
    EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``gem update``
    ``rvm list known``
    ``rvm install 2.4.1``
    ``rvm install 2.4.1`` *: adjust as needed, this app may not always be current to latest Ruby or Rails versions.*
    ``pwd``

    ``cd your_application_name``
    ``rvm gemset list``
    ``open -e Gemfile`` *: change Ruby version*
    @@ -127,7 +143,7 @@ Check your Rails version. Expect version to be 5.1.2 or later:
    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : **Rails5.1_app_name**
    Yes, change the _app_name to your app's name for easy reference.
    Yes, change the app_name to your app's name for easy reference.
    When you upgrade to Rails5.1 simply create a new gemset, and you
    can revert to the Rails5.1 gemset should the need arise.
    @@ -230,15 +246,15 @@ See A VALID NOTE above.
    **#ruby -v** *will respond with your Ruby version.*
    ``ruby -v``
    *If the response is not 2.3.0, tell rvm to use Ruby-2.3.0*
    ``rvm use 2.3.0``
    *If the response is not 2.4.1, tell rvm to use Ruby-2.4.1*
    ``rvm use 2.4.1``
    *If the response is not, **You are now using Ruby 2.3.0**, run
    **#rvm list known** to show you what rubies rvm knows about.*
    ``rvm list known``
    *If the 2.3.0 Ruby is not showing, run this lovely command.*
    ``rvm install 2.3.0``
    ``rvm install 2.4.1``
    *Watch for rvm install instructions, if any, and use them.*
    *Voila, you are now on Ruby 2.4.1 and yes, it is that easy.*
  27. kathyonu revised this gist Jul 29, 2017. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -42,13 +42,13 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    *If all is well on rails response*, skip to `bundle update rails`, otherwise do this:
    ``open -e Gemfile`` *: change Rails version*

    ``gem install rails``

    If all is not well, check your gemset with `rvm gemset list` and decipher terminal response.
    If you see an error such as:
    ```Ignoring executable-hooks-1.3.2 because its extensions are not built.
    Try: gem pristine executable-hooks --version 1.3.2
    ```
    Try: gem pristine executable-hooks --version 1.3.2```
    It means you have are in global gemset or you have a new gemset, and you need to verify your gemset with:
    `rvm gemset list`
    @@ -61,6 +61,10 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.
    ``bundle update rails``
    If you ever lose track of where you are, commands wise, just type into your Terminal:
    ``history``
    Now, run `bundle_install` and it should be clean through up to date, no additions or changes:
    ``bundle install``
    @@ -70,7 +74,7 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.
    ``bundle outdated``
    This is a not a safe command, possibly updating many gems, changing many things:
    Next command is not a safe one, possibly updating many gems, changing many things:
    See A VALID NOTE above, and note here below before running `bundle update`
  28. kathyonu revised this gist Jul 28, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -161,6 +161,10 @@ As needed to be current, make appropriate changes here:
    Before you push to production, check your Gemfile.lock for vulnerabilites:
    > [Is It Vulnerable ?](https://isitvulnerable.com/)
    Fire it up with:

    ``rails s``

    ### INSTRUCTIONS :

    *Use the global gemset for this part.*
  29. kathyonu revised this gist Jul 28, 2017. 1 changed file with 68 additions and 49 deletions.
    117 changes: 68 additions & 49 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -24,19 +24,22 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``gem update``
    ``rvm list known``
    ``rvm install 2.2.5``
    ``rvm install 2.4.1``
    ``pwd``
    ``cd your_application_name``
    ``rvm gemset list``
    ``open -e Gemfile`` *: change Ruby version*
    ``open -e .ruby-version`` *: change Ruby version*
    ``open -e .ruby-gemset`` *: change Ruby version*
    ``rvm use 2.2.5``
    ``rvm gemset use Rails5_app_name --create --default``
    *with above command used once, below is never needed*
    ``rvm gemset use Rails5.2_app_name``
    ``rvm use 2.4.1``
    ``rvm gemset use Rails5_app_name --create --default``

    *with above command used once, below is never needed*

    ``rvm gemset use Rails5.1_app_name``
    ``ruby -v``
    ``rails -v``
    ``rails -v``

    *If all is well on rails response*, skip to `bundle update rails`, otherwise do this:
    ``open -e Gemfile`` *: change Rails version*
    ``gem install rails``
    @@ -55,23 +58,36 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.
    `gem install rails`

    NOW, you can run this one:

    ``bundle update rails``

    Now, run `bundle_install` and it should be clean through up to date, no additions or changes:

    ``bundle install``
    ``bundle outdated``

    Now, do we have any outdated gems ?
    This is a safe command, changing nothing:

    ``bundle outdated``

    See A VALID NOTE above.
    This is a not a safe command, possibly updating many gems, changing many things:

    Run `bundle outdated` before you run the following update command.
    See A VALID NOTE above, and note here below before running `bundle update`

    Run `bundle outdated` before you blindly run the following update command.
    You can see how many gems will be updated if all are done with one command.
    You can update one by one with `bundle update gem_name`
    You can update gems one by one with `bundle update gem_name`

    Do a `git commit` command before you run this updates-all-gems-command.
    Recommend you do a `git commit` command before you run this
    updates-all-gems-command, IF you have many gems outdated.

    ``bundle update``
    ``bundle update``
    ``ruby -v``
    ``ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin16]
    ``ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]``

    ``rails -v``
    ``Rails 5.1.2``

    ``gem list``

    Before you push to production, check your Gemfile.lock for vulnerabilites:
    @@ -89,7 +105,7 @@ Before you push to production, check your Gemfile.lock for vulnerabilites:
    > `brew doctor`
    **#rvm list known** will show you the [Rubies rvm knows about and can install](http://rvm.io/rubies/installing).
    If you do not see Ruby 2.3.0 in the list, we will cover what to do further below.
    If you do not see Ruby 2.4.1 in the list, we will cover what to do further below.
    `rvm list known`

    **#pwd** will show you what directory you are in:
    @@ -98,21 +114,26 @@ If you do not see Ruby 2.3.0 in the list, we will cover what to do further below
    Change into your working directory:
    > `cd your-application-name`
    Check your Ruby version. Expect version to be 2.3.0 or later:
    Check your Ruby version. Expect version to be 2.4.1 or later:
    > `ruby -v`
    Check your Rails version. Expect version to be 4.2.6 or later:
    Check your Rails version. Expect version to be 5.1.2 or later:
    > `rails -v`
    Choose your correct gemset for your app, if you have more than one.
    Let us presume this is your first gemset ..
    We will create a good name for it : **Rails4.2_app_name**
    We will create a good name for it : **Rails5.1_app_name**
    Yes, change the _app_name to your app's name for easy reference.
    For the first time use, we will add the create and default switches.
    > `rvm gemset use Rails4.2_app_name --create --default`
    When you upgrade to Rails5.1 simply create a new gemset, and you
    can revert to the Rails5.1 gemset should the need arise.

    For the first time use, we will add the create and default switches.

    `rvm gemset use Rails5.1_app_name --create --default`

    Run thhis command again, you will see the gemset is being used:

    Run the prior command again, you will see the gemset is being used:
    > `rvm gemset list`
    `rvm gemset list`

    You just created and are now using the application's gemset.
    The `--default` switch will cause this gemset to be used when
    @@ -122,21 +143,21 @@ the rvm magic show itself as it recognizes the new gemset.

    If you ever change gemsets, the `use` command is the way back.
    However, at this point, when you change directory into this app,
    the `.ruby-gemset` file will be used to set the correct gemset:
    > `rvm gemset use Rails4.2_app_name`
    the `.ruby-gemset` file will be used to set the correct gemset.

    You can use the command to change gemsets and change back:
    > `rvm gemset use Rails4.2_app_name`
    > `rvm gemset use Rails5_app_name_stage`

    `rvm gemset use Rails5.1_app_name`
    `rvm gemset use Rails5.2_app_name`

    Your app is now ready to go.
    At any time you can do the steps above to keep your app humming.

    As needed to be current, make appropriate changes here:
    > `open -e .ruby-gemset`
    > `open -e .ruby-version`
    > `bundle install`
    > `bundle install`
    Before you push to production, check your Gemfile.lock for vulnerabilites:
    > [Is It Vulnerable ?](https://isitvulnerable.com/)
    @@ -191,12 +212,12 @@ See A VALID NOTE above.
    *Make sure the .ruby-version file shows 2.3.0*
    *You can use the `open -e file-address` command at the terminal_prompt.*

    ``open -e Gemfile`` : add the current version of Rails, currently 4.2.6
    ``open -e .ruby-version`` : currently it reads as 2.2.3
    ``open -e .ruby-gemset`` : currently reads as Rails-4_2_app_name
    ``open -e Gemfile`` : add the current version of Rails, currently 5.1.2
    ``open -e .ruby-version`` : currently it reads as 2.4.1
    ``open -e .ruby-gemset`` : currently reads as Rails5.1_app_name

    *Make sure the* ``.ruby-gemset`` *file reads as your real* ``app-gemset-name``.
    *Further below, we will be giving the gemset the name of,* ``Rails4.2_app_name``.
    *Further below, we will be giving the gemset the name of,* ``Rails5.1_app_name``.

    **#ruby -v** *will respond with your Ruby version.*
    ``ruby -v``
    @@ -212,9 +233,9 @@ See A VALID NOTE above.
    ``rvm install 2.3.0``

    *Watch for rvm install instructions, if any, and use them.*
    *Voila, you are now on Ruby 2.3.0 and yes, it is that easy.*
    *Now that you are using 2.3.0 we can create the gemset. *
    ``rvm gemset use Rails4.2_app_name --create --default``
    *Voila, you are now on Ruby 2.4.1 and yes, it is that easy.*
    *Now that you are using 2.4.1 we can create the gemset. *
    ``rvm gemset use Rails5.1_app_name --create --default``

    *At this point, I personally like to close that terminal window*
    *and open a new one, and watch the rvm magic show itself as it*
    @@ -223,33 +244,34 @@ See A VALID NOTE above.
    *If you ever change gemsets, this is the way back. *
    *(However, at this point, when you change directory into this app,*
    *the .ruby-gemset file will be used to set the correct gemset.)*
    ``rvm gemset use Rails4.2_app_name``
    ``rvm gemset use Rails5.1_app_name``

    *Check your Ruby version. Expect version to be 2.3.0*
    *Check your Ruby version. Expect version to be 2.4.1*
    ``ruby -v``

    *Check your Rails version. Expect version to be 4.2.6*
    *Check your Rails version. Expect version to be 5.1.2*
    ``rails -v``

    *If you are not yet using Rails4.2.6, this is the point that you do so.*
    *If you are not yet using Rails5.1.2, this is the point that you do so.*
    ``gem install rails``

    *Notice it is not, ``bundle install`` here, we use ``gem install``.*
    *Notice it is not, ``bundle install`` here, we used ``gem install``.*

    *Make sure you do not skip this next step.*
    ``bundle update rails``

    *Now we let Bundler do its work of installing all the requisite gems, and dependencies.*
    *Now we see if `bundle update rails` did its work of installing all the requisite gems, and dependencies.*
    ``bundle install``


    *It should be a clean response with no additions or changes.*

    *If you have difficulties here, trash your Gemfile.lock file, then run the
    ``bundle install`` command again.*


    *Next we update Rails and it is important to do this every time you upgrade Rails versions.*
    ``rake rails:update``

    *If the process asks you if you want to overwrite a file, type in ``diff`` and it will*
    *If the process asks you if you want to overwrite a file, type in ``d`` for ``diff`` and it will*
    *show you the changes it is about to make. If you have working code in your file,*
    *that cannot be overwritten, and yet there is new code to be added, simply open*
    *the file it wants to overwrite, and make those additions by hand, save the file, close it, and choose ``n`` : do not allow the overwrite. That preserves your code and adds new.*
    @@ -268,13 +290,10 @@ See A VALID NOTE above.
    *Bundler now does its magic.*
    *Follow any instructions bundler gives you while it updates.*

    **#rake rails:update:bin** *will update your bin/bundle, bin/rails and bin/rake files.*
    ``rake rails:update:bin``

    *Now check your Rails version, it should read 4.2.6 *
    *Now check your Rails version, it should read 5.1.2*
    ``rails -v``

    *Your Ruby version should read as 2.3.0 *
    *Your Ruby version should read as 2.4.1 *
    ``ruby -v``

    ###### Your app is now updated, Ruby, Rails and gems wise
  30. kathyonu revised this gist Jul 23, 2017. 1 changed file with 29 additions and 8 deletions.
    37 changes: 29 additions & 8 deletions Rails-applications-health-codes.md
    Original file line number Diff line number Diff line change
    @@ -24,33 +24,54 @@ EXAMPLE: `bundle update launchy` and then run tests that use Launchy, to check.

    ``gem update``
    ``rvm list known``
    ``rvm install 2.3.0``
    ``rvm install 2.2.5``
    ``pwd``
    ``cd your_application_name``
    ``rvm gemset list``
    ``open -e Gemfile`` *: change Ruby version*
    ``open -e .ruby-version`` *: change Ruby version*
    ``open -e .ruby-gemset`` *: change Ruby version*
    ``rvm use 2.3.0``
    ``rvm gemset use Rails4.2_app_name --create --default``
    ``rvm use 2.2.5``
    ``rvm gemset use Rails5_app_name --create --default``
    *with above command used once, below is never needed*
    ``rvm gemset use Rails4.2_app_name``
    ``rvm gemset use Rails5.2_app_name``
    ``ruby -v``
    ``rails -v``
    *If all is well on rails response, skip to `bundle update rails`, otherwise do this:
    *If all is well on rails response*, skip to `bundle update rails`, otherwise do this:
    ``open -e Gemfile`` *: change Rails version*
    ``gem install rails``
    ``gem install rails``

    If all is not well, check your gemset with `rvm gemset list` and decipher terminal response.
    If you see an error such as:
    ```Ignoring executable-hooks-1.3.2 because its extensions are not built.
    Try: gem pristine executable-hooks --version 1.3.2
    ```
    It means you have are in global gemset or you have a new gemset, and you need to verify your gemset with:

    `rvm gemset list`

    changing gemset will work, or, with new gemset selected, run:

    `gem install rails`

    NOW, you can run this one:
    ``bundle update rails``
    ``bundle install``
    ``rake rails:update``
    ``bundle outdated``

    See A VALID NOTE above.

    Run `bundle outdated` before you run the following update command.
    You can see how many gems will be updated if all are done with one command.
    You can update one by one with `bundle update gem_name`

    Do a `git commit` command before you run this updates-all-gems-command.

    ``bundle update``
    ``rake rails:update:bin``
    ``ruby -v``
    ``ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin16]
    ``rails -v``
    ``Rails 5.1.2``
    ``gem list``

    Before you push to production, check your Gemfile.lock for vulnerabilites: