Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails heroku ActionView::Template::Error(未定义的方法`email';_Ruby On Rails_Heroku - Fatal编程技术网

Ruby on rails heroku ActionView::Template::Error(未定义的方法`email';

Ruby on rails heroku ActionView::Template::Error(未定义的方法`email';,ruby-on-rails,heroku,Ruby On Rails,Heroku,我一直在尝试在heroku上部署一个应用程序,但遇到了很多问题。我当前的问题是,在注册时,我收到一个未定义的方法,声称电子邮件不是Mate对象的已定义函数。我已经运行了 heroku run rake db:migrate 及 这似乎无法解决问题。此外,当我进入heroku终端并查看新的Mate对象时,它具有电子邮件属性。以下是我的heroku日志: 2013-07-14T22:38:29.637842+00:00 app[web.1]: Processing by HomeControlle

我一直在尝试在heroku上部署一个应用程序,但遇到了很多问题。我当前的问题是,在注册时,我收到一个未定义的方法,声称电子邮件不是Mate对象的已定义函数。我已经运行了

heroku run rake db:migrate

这似乎无法解决问题。此外,当我进入heroku终端并查看新的Mate对象时,它具有电子邮件属性。以下是我的heroku日志:

2013-07-14T22:38:29.637842+00:00 app[web.1]: Processing by HomeController#index as HTML
2013-07-14T22:38:29.650497+00:00 app[web.1]:   Rendered home/index.html.erb within layouts/application (9.1ms)
2013-07-14T22:40:36.729670+00:00 app[web.1]: Started POST "/houses" for 71.202.122.134 at             2013-07-14 22:40:36 +0000
2013-07-14T22:40:36.803157+00:00 app[web.1]: Processing by Houses::RegistrationsController#create as HTML
2013-07-14T22:40:36.803157+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"Fsl63CocaqA04/vhoDC0sU/CCSd2YGasqudyCleDNbc=", "house"=>{"address"=>"90 Castro", "city"=>"San Francisco", "email"=>"zyskowski.rob@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
2013-07-14T22:40:37.085467+00:00 app[web.1]: Redirected to http://frozen-spire-1369.herokuapp.com/mates/sign_up
2013-07-14T22:40:37.085467+00:00 app[web.1]: Completed 302 Found in 282ms (ActiveRecord: 0.0ms)
2013-07-14T22:40:37.266161+00:00 app[web.1]: Processing by Mates::RegistrationsController#new as HTML
2013-07-14T22:40:37.276199+00:00 app[web.1]:   Rendered mates/registrations/new.html.erb within layouts/application (8.2ms)
2013-07-14T22:40:37.088159+00:00 heroku[router]: at=info method=POST path=/houses host=frozen-spire-1369.herokuapp.com fwd="71.202.122.134" dyno=web.1 connect=1ms service=368ms status=302 bytes=118
2013-07-14T22:40:37.282256+00:00 heroku[router]: at=info method=GET path=/mates/sign_up host=frozen-spire-1369.herokuapp.com fwd="71.202.122.134" dyno=web.1 connect=1ms service=42ms status=500 bytes=643
2013-07-14T22:40:37.278470+00:00 app[web.1]:     24:                     <div class="controls">
2013-07-14T22:40:37.278470+00:00 app[web.1]:     27:                </div>
2013-07-14T22:40:37.278470+00:00 app[web.1]:     28:    
2013-07-14T22:40:37.278470+00:00 app[web.1]: ActionView::Template::Error (undefined method `email' for #<Mate:0x007f2d5d8efc88>):
2013-07-14T22:40:37.278470+00:00 app[web.1]:     23:                     <%= f.label :email, :class => "control-label" %>
2013-07-14T22:40:37.278470+00:00 app[web.1]: 
2013-07-14T22:40:37.256850+00:00 app[web.1]: Started GET "/mates/sign_up" for 71.202.122.134 at 2013-07-14 22:40:37 +0000
2013-07-14T22:40:37.278470+00:00 app[web.1]:   app/views/mates/registrations/new.html.erb:25:in `block in _app_views_mates_registrations_new_html_erb___482835816309687038_69916399610600'
2013-07-14T22:40:37.276313+00:00 app[web.1]: Completed 500 Internal Server Error in 10ms
2013-07-14T22:40:37.278470+00:00 app[web.1]:     22:                 <div class= "control-group">
2013-07-14T22:40:37.278470+00:00 app[web.1]:     25:                          <%= f.text_field :email, :placeholder => "email" , :autofocus => true %>
2013-07-14T22:40:37.278470+00:00 app[web.1]:     26:                     </div>
2013-07-14T22:40:37.278704+00:00 app[web.1]:   app/views/mates/registrations/new.html.erb:9:in `_app_views_mates_registrations_new_html_erb___482835816309687038_69916399610600'
2013-07-14T22:40:37.278704+00:00 app[web.1]: 
2013-07-14T22:40:37.278704+00:00 app[web.1]: 
2013-07-14T22:38:29.637842+00:00应用程序[web.1]:由HomeController处理#索引为HTML
2013-07-14T22:38:29.650497+00:00应用程序[web.1]:在布局/应用程序中呈现home/index.html.erb(9.1ms)
2013-07-14T22:40:36.729670+00:00应用程序[网站1]:于2013-07-14 22:40:36+0000开始发布71.202.122.134的“房屋”
2013-07-14T22:40:36.803157+00:00应用程序[web.1]:房屋处理::注册控制器#创建为HTML
2013-07-14T22:40:36.803157+00:00应用程序[web.1]:参数:{“utf8”=>“✓", "真实性令牌“=>”Fsl63CocaqA04/vhoDC0sU/CCSd2YGasqudyCleDNbc=“,”房子“=>{”地址“=>”90卡斯特罗“,”城市“=>”旧金山“,”电子邮件“=>”兹斯科夫斯基。rob@gmail.com“,“密码”=>“[筛选]”,“密码确认”=>“[筛选]”},“提交”=>“注册”}
2013-07-14T22:40:37.085467+00:00应用程序[web.1]:重定向到http://frozen-spire-1369.herokuapp.com/mates/sign_up
2013-07-14T22:40:37.085467+00:00应用程序[web.1]:在282毫秒内完成302次(ActiveRecord:0.0毫秒)
2013-07-14T22:40:37.266161+00:00应用程序[web.1]:Mates处理::RegistrationsController#新的HTML格式
2013-07-14T22:40:37.276199+00:00应用程序[web.1]:在布局/应用程序中呈现配偶/注册/new.html.erb(8.2ms)
2013-07-14T22:40:37.088159+00:00 heroku[路由器]:at=info-method=POST-path=/houses-host=freezed-spire-1369.herokuapp.com fwd=“71.202.122.134”dyno=web.1 connect=1ms服务=368ms状态=302字节=118
2013-07-14T22:40:37.282256+00:00 heroku[路由器]:at=info method=GET path=/mates/sign\u up host=freezed-spire-1369.herokuapp.com fwd=“71.202.122.134”dyno=web.1 connect=1ms服务=42ms状态=500字节=643
2013-07-14T22:40:37.278470+00:00应用程序[网站1]:24:
2013-07-14T22:40:37.278470+00:00应用程序[网站1]:27:
2013-07-14T22:40:37.278470+00:00应用程序[网站1]:28:
2013-07-14T22:40:37.278470+00:00应用程序[web.1]:ActionView::Template::Error(未定义#的“email”方法):
2013-07-14T22:40:37.278470+00:00应用程序[网站1]:23:“控制标签”%>
2013-07-14T22:40:37.278470+00:00应用程序[网站1]:
2013-07-14T22:40:37.256850+00:00应用程序[web.1]:于2013-07-14 22:40:37+0000开始获得71.202.122.134的“伴侣/注册”
2013-07-14T22:40:37.278470+00:00应用程序[web.1]:app/views/mates/registrations/new.html.erb:25:in ` block in `应用程序视图` mates\registrations\u new\u html\u erb\uu 482835816309687038\u 69916399610600'
2013-07-14T22:40:37.276313+00:00应用程序[web.1]:在10毫秒内完成500个内部服务器错误
2013-07-14T22:40:37.278470+00:00应用程序[网站1]:22:
2013-07-14T22:40:37.278470+00:00应用程序[web.1]:25:“电子邮件”,自动对焦=>true%>
2013-07-14T22:40:37.278470+00:00应用程序[网站1]:26:
2013-07-14T22:40:37.278704+00:00应用程序[web.1]:app/views/mates/registrations/new.html.erb:9:in``应用程序视图\伴侣\注册\新\ html \ erb\ uuuuuuuuu482835816309687038\ u69916399610600'
2013-07-14T22:40:37.278704+00:00应用程序[网站1]:
2013-07-14T22:40:37.278704+00:00应用程序[网站1]:

我被困在这里,所以任何想法都很受欢迎!谢谢!

我猜无论你在哪个视图中看到错误,
电子邮件都是空白的。在你的视图中写下如下内容:

<%= @user.email if @user.email? %> 

什么是
Mate
?如何将
email
字段添加到
mates
表中?是否有迁移?迁移是否提交到版本控制?是否将最新提交推送到Heroku?
<%= @user.email if @user.email? %>