我试图找到一些解决方案,但我真的找不到任何与我运行rails命令时出现的错误相关的东西:
rails生成模型书标题:字符串摘要:文本isbn:字符串
/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
有人知道是什么原因导致了这些错误吗?
发布于 2017-01-04 20:47:23
出现此警告是因为您使用的是ruby 2.4.0。
这个版本引入了这个变化:Unify Fixnum and Bignum into Integer
请看这里的公告:https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/
警告来自activesupport gem,它是rails的一部分,将在即将发布的版本中修复。
现在,您可以忽略这些警告。
更新: Rails 5.0.2 has been released,它消除了警告。
发布于 2017-03-07 11:14:30
我通过更新rails修复了我的问题
bundle update rails
发布于 2017-01-04 20:45:13
我假设您使用的是Rails5?查看this link (接近底部)。看起来这些警告将在版本#27458中消失。
https://stackoverflow.com/questions/41463999
复制相似问题