Ich versuche, die Rails-Version meiner App von 4.2.6 auf 5 zu aktualisieren, aber ich stehe mit dem folgenden Fehler fest.Server beendet nach dem Upgrade auf Rails 5.0.0.rc1 von Rails 4.2.6
[email protected]:~/workspace/converse (rails5update) $ rails server -b $IP -p $PORT
=> Booting WEBrick
=> Rails 5.0.0.rc1 application starting in development on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
Exiting
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.rc1/lib/active_support/core_ext/hash/keys.rb:79:in `block in assert_valid_keys': Unknown key: :order. Valid keys are: :class_name, :anonymous_class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type, :index_errors (ArgumentError)
from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.rc1/lib/active_support/core_ext/hash/keys.rb:77:in `each_key'
from /usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.rc1/lib/active_support/core_ext/hash/keys.rb:77:in `assert_valid_keys'
from /usr/local/rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.rc1/lib/active_record/associations/builder/association.rb:78:in `validate_options'
den Umfang
#default_scope -> { order: 'created_at DESC' }
scope :created_at, -> { order('created_at DESC') }
Changed
Added Juwel Dateien
gem "responders"
Erstellt
models/application_record.rb
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
dafür gesorgt, dass alle Modelle von dieser neuen Klasse erben, zum Beispiel:
models/user.rb
class User < ApplicationRecord
[...]
end
Wer hat das gleiche Problem?
Vielen Dank @ salma-gooma, ich habe eine [neue Ausgabe auf Mailbox] (https://github.com/mailboxer/mailboxer/issues/427) hinzugefügt, die auf diese Antwort verweist, um das Problem besser zu dokumentieren. . –