[英]undefined method `explain' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter
我是Ruby on Rails的新手,但我已經學過一些教程,並且知道我的方法。 我已經生成了一些腳手架並將數據插入到MySql數據庫中。
導航到index.html.erb時,我收到標題中的錯誤
控制器正在執行索引
def index
@beers = Beer.all
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @beers }
end
end
並將此作為一種結構
Beer: id, brewer_id, name, price, score, color, brew_type, create_at, updated_at
RoR正在為我創建的其他腳手架工作,並列出數據。 我更新了實體Beer的mysql結構,它可能沒有反映rails中的變化(dunno)。
我是否需要一個不同的gem來將rails連接到mysql db? 任何關於檢查什么的建議都將受到贊賞(:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.