我刚将我的应用程序部署到Heroku,我正面临着这个问题。在注册页面中:
<div class="field">
<%= f.label :bio %><br />
<%= f.text_field :bio %>
</div>
并在日志中
ActionView::Template::Error (undefined method `bio' for #<User:0x007f5e772493c0>):
<div class="field">
<%= f.label :bio %><br />
<%= f.text_field :bio %>
</div>
对此有何想法?谢谢 PS。用于在部署之前正常工作
修改
我尝试迁移但是我收到了此错误
Couldn't create database for {"adapter"=>"sqlite3", "pool"=>5, "timeout"=>5000, "database"=>"db/test.sqlite3"}
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
答案 0 :(得分:1)
您无法运行迁移,导致其无法为用户找到列:bio
。
在您的控制台上运行此命令
heroku run rake db:migrate