スタック・オーバーフローに参加する
684万人以上のプログラマーが集まるスタック・オーバーフローに参加しませんか?
簡単な登録後、すぐにご利用いただけます。
登録

I've tried to find some solution for this, but I really couldn't find anything related with the errors that is appearing to me when I run the rails command: 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

Anyone know what may be causing these errors?

share|improve this question
    
Thanks a bunch! I'll ignore those warnings until the next version of Ruby comes out. – user7374147 Jan 4 at 13:01
1  
It's not a bug, it's a feature ;) – cobaltsoda Jan 7 at 3:52
up vote 31 down vote accepted

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.

share|improve this answer
1  
I use ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16] but also get this issue. – aircraft Jan 26 at 14:39
    
How do I ignore the warnings? Running "rails s" fails – Sauron Feb 25 at 22:10
    
@Sauron It should not fail because of warnings. Maybe you have some error additionally? – IngoAlbers Feb 26 at 5:20
    
Are there anything new regarding this? It's annoying to get those warnings thrown in my face all the time. Grrr! – Zeth Mar 1 at 22:40
    
@Zeth In fact, yes. Rails 5.0.2 has been released, which gets rid of the warnings. weblog.rubyonrails.org/2017/3/1/Rails-5-0-2-has-been-release‌​d – IngoAlbers Mar 2 at 7:49

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

share|improve this answer

If these deprecation warnings in active support are the only warnings you are seeing, you can surpress them by passing a RUBYOPT bash variable with the -W0 option which will silence.

so instead of rails server try: RUBYOPT="-W0" rails server or RUBYOPT="-W0" bin/rails server

In rails 5.0 you may want to get in the habit of using bin/rails not just rails, since that's the global rails version which may or may not be the same as your local rails version.

share|improve this answer

I fixed mine by updating rails

bundle update rails
share|improve this answer
    
Thanks, i can fix it too – Esgi Dendyanri Mar 8 at 9:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.