Tag: ruby在轨道上5

警告:常量:: Fixnum已弃用当生成新模型时

我试图find一些解决scheme,但我真的找不到任何与运行rails命令时出现的错误相关的任何内容: 导轨生成模型书名:string摘要: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 任何人都知道可能会导致这些错误?

“:nothing”选项已被弃用,并将在Rails 5.1中被删除

这个代码在rails 5中 class PagesController < ApplicationController def action render nothing: true end end 导致以下弃用警告 DEPRECATION WARNING: :nothing` option is deprecated and will be removed in Rails 5.1. Use `head` method to respond with empty response body. 我该如何解决?