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

Question

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

Answers 2
Added at 2017-01-04 13:01
Tags
Question

First time poster here.I've tried to find solutions online for this but couldn't find anything I could relate to my.

All related code:

$ rails generate model Book title:string summary:text isbn:string
/home/vmu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/home/vmu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
/home/vmu/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
Running via Spring preloader in process 3579
Expected string default value for '--jbuilder'; got true (boolean)
      invoke  active_record
   identical    db/migrate/20170104114702_create_books.rb
   identical    app/models/book.rb
      invoke    test_unit
   identical      test/models/book_test.rb
   identical      test/fixtures/books.yml
Answers to

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

nr: #1 dodano: 2017-01-04 13:01

I assume you're using Rails 5? Check out this link (towards the bottom). Looks like these warnings will go away with release #27458.

nr: #2 dodano: 2017-01-04 13:01

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.

Source Show
◀ Wstecz