我正在开发一个rails应用程序,到目前为止在生产中工作正常。但是,一旦我推送到heroku,下面的代码:
<% @instructors.each do |i| %>
<li><%= i.name %></li>
<li><%= i.email %></li>
<li><%= i.description %></li>
<% end %>
给了我以下错误:
Rendered /Users/ericabt1/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.9ms)
Rendered /Users/ericabt1/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/routes/_route.html.erb (3.9ms)
Rendered /Users/ericabt1/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.2ms)
Rendered /Users/ericabt1/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (48.1ms)
任何想法为什么?我是Rails的新手。
答案 0 :(得分:0)
您必须运行命令heroku run rake db:migrate
答案 1 :(得分:0)
Heroku没有您在本地应用中的数据 - 因此错误
您应该创建Heroku数据库,或使用rake db:migrate
创建本地应用程序中的数据库