Warning: Constant ::Fixnum Is Deprecated When Generating New Model

warning: constant ::Fixnum is deprecated When generating new model

This warnings appear because you are using ruby 2.4.0.

This version introduced this change: Unify Fixnum and Bignum into Integer

See here for the announcement: https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/

The warnings come from the activesupport gem which is part of rails and will be fixed in an upcoming release.

For now you can just ignore those warnings.

Update: Rails 5.0.2 has been released, which gets rid of the warnings.

Fixnum is deprecated - when I run rake db: seed

Ruby version 2.4.0 (~Dec 2016) unified Fixnum and Bignum into Integer and deprecated Fixnum. You're probably using ruby version 2.4.0 or later. Your version 1.13.2 of the roo gem is older than that (~Dec 2013) and is using Fixnum. Thus you get the warning.

Your code will still run fine for now with the warning, but if you want to get rid of it, you could upgrade your roo gem. The latest version is 2.8.3 (Feb 2020). If you do upgrade, you may have some code changes to do depending upon what may have changed in the newer version of the gem.

Deprecation Warning for ActiveSupport Gem

It looks like your error is because of your ruby/rails versions.

See Rails issue on Github

To update your rails/ruby versions:

Ruby -- go to the ruby downloads page and follow the instructions for your operating system.

Rails -- go to the github instructions for updating rails

After upgrading to ruby 2.5.1 the rails server failing with warning: constant ::Fixnum is deprecated

You can try using an earlier version of ruby. I'm on rails 4.2.7.1 with ruby 2.3.1 and all is fine.

Alternatively, and according to this issue on Github, you can upgrade to rails 4.2.8 or higher for ruby 2.4 (and presumably higher) support.

How do I resolve this error that keeps me from starting rails server?

Im not sure if that's the issue, since what you are seeing is just a warning. That warning appears because you are using ruby 2.4.0.

This version introduced this change: Unify Fixnum and Bignum into Integer

See here for the announcement: https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/Z

The warnings come from the activesupport gem which is part of rails, and they will fix it soon.

Try downgrading your Ruby Version to 2.1 and try again.

Source

502 server error on gcloud with Ruby on Rails

This can help:

This warnings appear because you are using ruby 2.4.0

warning: constant ::Fixnum is deprecated When generating new model

We don’t have to worry about this change most of the times in our application code. But libraries like Rails use the class of numbers for taking certain decisions. These libraries need to support both Ruby 2.4 and previous versions of Ruby.



Related Topics



Leave a reply



Submit