【发布时间】:2020-08-06 19:38:42
【问题描述】:
我正在构建一个超级基础的格斗游戏词典。该应用程序在本地主机上运行,在 Heroku 本地上没有问题。
这是我的模型
class Vocabulary < ApplicationRecord
validates :word, presence:true
validates :definition, presence:true
has_many :users, :through => :favorites
end
这是我的架构
create_table "vocabularies", force: :cascade do |t|
t.string "word", null: false
t.string "definition", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
这是我在运行 heroku run rails 控制台时收到的错误
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.2.3/lib/active_model/attribute_assignment.rb:53:in `_assign_attribute': unknown attribute 'Word' for Vocabulary. (ActiveModel::UnknownAttributeError)
我试过了: Heroku rake db:迁移, 重置我的数据库, 从heroku中删除应用程序并重建, 哭得很厉害
我完全没有想法,所以非常感谢任何帮助。
谢谢!
【问题讨论】:
-
什么时候出现错误?堆栈跟踪是什么?
-
请用错误堆栈跟踪编辑问题
-
从“Word”属性发送到哪里?看来您正在使用大写字母“W”
标签: ruby-on-rails heroku