Ruby Rails test error “warning: constant :: Fixnum is deprecated”

I got the below error while trying to run the Ruby Test case in Ubuntu VM.

Error Trace:

/home/bala/.rvm/gems/ruby-2.4.1/gems/watir-webdriver-0.9.3/lib/watir-webdriver/elements/html_elements.rb:17: warning: constant ::Fixnum is deprecated

Follow the below steps to get rid of the above error.

1. Uninstall Rails completely. Execute the below commands one by one.

   gem uninstall rails
   gem uninstall railties

2. Then run the below command to install the rails.

gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL | bash -s stable --rails

3. Update the watir version in my Gemfile to 6.1 from 5.0.0

4. Then run the below command and then run your test case.

  bundle install