I'm trying to deploy to Heroku, of a project in Rails 4.2.7.1 and with Ruby 2.1.6, what happens. When deploying on Heroku it throws me an error
remote:
remote: !
remote: ! An error occurred while installing ruby-2.1.6
remote: !
remote: ! Heroku recommends you use the latest supported Ruby version listed here:
remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: !
remote: ! For more information on syntax for declaring a Ruby version see:
remote: ! https://devcenter.heroku.com/articles/ruby-versions
remote: !
remote: !
remote: ! Debug InformationCommand: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.1.6.tgz -s -o - | tar zxf - ' failed unexpectedly:
remote: !
remote: ! gzip: stdin: unexpected end of file
remote: ! tar: Child returned status 1
remote: ! tar: Error is not recoverable: exiting now
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
I was reading and it is because of the version of Ruby that is no longer supported on Heroku, I searched the Internet to update the version of Ruby to 2.4.9 and it seems that it was updated but when I execute rails s
it I get another error
/home/siscoteli5/.rvm/gems/ruby-2.4.9/gems/activesupport-4.2.7.1/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated /home/siscoteli5 /.rvm/gems/ruby-2.4.9/gems/activesupport-4.2.7.1/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated Exiting /home/siscoteli5/.rvm /gems/ruby-2.4.9/gems/activesupport-4.2.7.1/lib/active_support/core_ext/numeric/conversions.rb:125:in `is_a?': stack level too deep (SystemStackError)
I've been searching and trying for a while now but I can't update the Ruby version without the Rails version exploding to be able to deploy.
What you mention is a compatibility error between ruby 2.4 and old versions of rails, specifically because in ruby 2.4 it was unified
Fixnum
andBignum
in a single classInteger
.The bug was fixed for rails 4.2.8, so upgrading to that version should fix your problem (or while you're at it, better to the latest 4.2-stable which is 4.2.11.1, for any security issues in previous versions).
Ahhh and good luck with that update as they are always riddled with incompatibility issues.
As Alter mentions, you can update versions, but that could cause compatibility issues in your code. If you still want to do it, you can try different Ruby versions using rvm, all the instructions are at https://rvm.io/ , while for Rails what you have to do is remove the Gemfile.lock and then change the version of Rails in the Gemfile and give it bundle. Luck.