2016-09-14 48 views
0

我刚部署我的应用程序到Heroku,我面临着这个问题。在注册页面:为未定义的方法`生物'继续获取未识别的方法'字段'#<User:>

<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). 

回答

1

您还没有运行,多数民众赞成在迁移为什么它无法找到列:bio为用户。控制台

heroku run rake db:migrate 
+0

运行此命令,现在我越来越宝石:: LoadError:指定“sqlite3的”数据库适配器,但没有加载宝石。将'gem'sqlite3''添加到您的Gemfile中(并确保其版本处于ActiveRecord所要求的最低限度)。 –

+0

尝试在开发中移动'“sqlite3”'和在生产中移动''pg“' –

+0

它在一段时间后出于某种原因 –

相关问题