0

May be this is just a simple error but since I am Rails noobie any help to my problem will be greatly appreciated. I have been facing the following error everytime I start the rails server. I am using Ruby 2.6 and Rails 4.2

C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.2.0/lib/active_support/core_ext/object/duplicable.rb:85: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.2.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.2.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
Exiting
Traceback (most recent call last):
bin/rails: stack level too deep (SystemStackError)
DejaVu
  • 5
  • 1
  • Hi Abhinav, by looking at the errors you have provided, I'd recommend upgrading your project to the latest stable version of Rails. Or at least upgrading to the latest stable release of Rails 5. If you're unable to upgrade your project at this time, you may be able to get it to start by rolling back to an older stable version of Ruby, but I wouldn't recommend that. – Steven Foster Feb 15 '20 at 15:42
  • Hey Abhinav! I'd also recommend trying to upgrade to the latest stable versions for tech. Its quite likely that gem version doesn't play nicely with your rails/ruby version. If you can, a full stacktrace would also be helpful to help diagnose the issue better. – Brad Cypert Feb 15 '20 at 16:30

1 Answers1

0

Rails 4.2 does not support Ruby 2.6. You should be using Ruby 2.4 for Rails 4.2, as support for Ruby 2.4 was explicitly added in Rails 4.2.8.

If you wish to use Ruby 2.6 you'll want to use Rails 6. Upgrading from Rails 4.2 to 5 to 6 is a complex process so you'll most likely to have an easier time downgrading Ruby rather than upgrading Rails. Running Ruby 2.4 on Windows is an exercise left up to the reader, though.

You can read more about the compatibility between Ruby and Rails versions in this answer.

anothermh
  • 9,815
  • 3
  • 33
  • 52
  • yeah man you are absolutely correct, after trying fruitlessly for hours to install and run previous versions on Rails I just gave up and just installed Ruby 2.6 and Rails 6. – DejaVu Feb 16 '20 at 08:01